Difference between revisions of "Installation - Upgrade"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
Tag: 2017 source edit
m
Tag: 2017 source edit
 
(38 intermediate revisions by 8 users not shown)
Line 6: Line 6:
 
[[zh:安装_-_升级]]
 
[[zh:安装_-_升级]]
 
<!-- END interlang links -->
 
<!-- END interlang links -->
 +
[[Category:Admin_en]]
  
[[Category:Admin_en]]
 
 
{{TemplateDocUser}}
 
{{TemplateDocUser}}
  
Line 16: Line 16:
 
This chapter describe different available methods to install Dolibarr for the first time (from the most simple to the manual one). See next chapter for upgrades.
 
This chapter describe different available methods to install Dolibarr for the first time (from the most simple to the manual one). See next chapter for upgrades.
  
==On your dedicated computer/server (installation "On Premise")==
+
==Installation on your dedicated computer/server (installation "On Premise")==
 
===[[File:Logo_windows.png]] Manually or with DoliWamp===
 
===[[File:Logo_windows.png]] Manually or with DoliWamp===
 
- '''Prerequisite''': Windows
 
- '''Prerequisite''': Windows
Line 33: Line 33:
  
 
*Run the downloaded .exe and follow instructions.
 
*Run the downloaded .exe and follow instructions.
 +
  
 
===[[File:Logo_ubuntu.png]] With DoliDeb (Debian or Ubuntu .deb package)===
 
===[[File:Logo_ubuntu.png]] With DoliDeb (Debian or Ubuntu .deb package)===
Line 41: Line 42:
 
This process works only for Ubuntu or Debian Linux users and is recommended for user with little computer knowledge. If you are experienced with Apache, PHP and Mysql installation, the chapter 'with standard package' is better for you. However, if you are a newbie user and running Ubuntu, you can use DoliDeb. DoliDeb is a specialized Dolibarr distribution for Debian or Ubuntu. This distribution allows you to make an installation under Ubuntu with all prerequisites (Apache, Mysql, PHP) and with no computer knowledge.
 
This process works only for Ubuntu or Debian Linux users and is recommended for user with little computer knowledge. If you are experienced with Apache, PHP and Mysql installation, the chapter 'with standard package' is better for you. However, if you are a newbie user and running Ubuntu, you can use DoliDeb. DoliDeb is a specialized Dolibarr distribution for Debian or Ubuntu. This distribution allows you to make an installation under Ubuntu with all prerequisites (Apache, Mysql, PHP) and with no computer knowledge.
  
*Steps to install DoliDeb are described into page [[Dolibarr for Ubuntu or Debian]].
+
*Steps to install DoliDeb are described on page [[Dolibarr for Ubuntu or Debian]].
 +
 
  
 
===[[File:Logo_rpm.png|42px]] With DoliRpm (Fedora, Redhat, Mandriva, Mageia or OpenSuse .rpm package)===
 
===[[File:Logo_rpm.png|42px]] With DoliRpm (Fedora, Redhat, Mandriva, Mageia or OpenSuse .rpm package)===
Line 50: Line 52:
 
This process works only for Fedora, Redhat, Mandriva, Mageia or OpenSuse Linux users and is recommended for user with no computer knowledge. If you have experience with Apache, PHP and Mysql installation, next chapter 'with standard package' is better for you. However, if you are a newbie user and running Fedora or Redhat, you can use DoliRpm. DoliRpm is a specialized Dolibarr distribution for Fedora, Redhat or Mandriva. This distribution allows you to make an installation under such OS with all prerequisites (Apache, Mysql, PHP) and with no computer knowledge.
 
This process works only for Fedora, Redhat, Mandriva, Mageia or OpenSuse Linux users and is recommended for user with no computer knowledge. If you have experience with Apache, PHP and Mysql installation, next chapter 'with standard package' is better for you. However, if you are a newbie user and running Fedora or Redhat, you can use DoliRpm. DoliRpm is a specialized Dolibarr distribution for Fedora, Redhat or Mandriva. This distribution allows you to make an installation under such OS with all prerequisites (Apache, Mysql, PHP) and with no computer knowledge.
  
*Steps to install DoliRpm are described into page [[Dolibarr for Redhat or Fedora (rpm package)]] or [[Dolibarr for Mandriva or Mageia (rpm package)]] or [[Dolibarr for OpenSuse (rpm package)]].
+
*Steps to install DoliRpm are described into page [[Dolibarr for Redhat or Fedora (rpm package)]] or [[Dolibarr for Mandriva or Mageia (rpm package)]] or [[Dolibarr for OpenSuse (rpm package)]].<br />
  
 +
<br />
 
===[[File:Gnu.png]] With Dolibarr (standard .zip package or from git)===
 
===[[File:Gnu.png]] With Dolibarr (standard .zip package or from git)===
 
- '''Prerequisite''': Apache, PHP and a database server (MySQL or PostgreSQL) are already running correctly and user/pass (of a new database or root server) is known.
 
- '''Prerequisite''': Apache, PHP and a database server (MySQL or PostgreSQL) are already running correctly and user/pass (of a new database or root server) is known.
Line 64: Line 67:
 
*Check that main root or admin user/password couple for the server is known and works correctly. If this root or admin user/password is not known because not yet defined, read following chapter. Otherwise go on next step:
 
*Check that main root or admin user/password couple for the server is known and works correctly. If this root or admin user/password is not known because not yet defined, read following chapter. Otherwise go on next step:
  
==== MySQL or MariaDB database ====
+
====Preparation of MySQL or MariaDB database====
  
 
For Linux users, if you have just installed a MySQL or MariaDB server, the admin user is''' root'''. If the root password has never been set yet, you must run the following command to initialize the password:
 
For Linux users, if you have just installed a MySQL or MariaDB server, the admin user is''' root'''. If the root password has never been set yet, you must run the following command to initialize the password:
Line 82: Line 85:
 
And type your password ''newrootpass'' then \q to quit if the connection has been successful.
 
And type your password ''newrootpass'' then \q to quit if the connection has been successful.
  
==== PostgreSQL database ====  
+
====Preparation of PostgreSQL database====  
  
 
For Linux users, if you have just installed a PostgreSQL server, you must run the following command to initialize an admin user and password. For this, add the following line in file '''/etc/postgresql/x.x/main/pg_hba.conf''' (replace x.x with your postgres version)
 
For Linux users, if you have just installed a PostgreSQL server, you must run the following command to initialize an admin user and password. For this, add the following line in file '''/etc/postgresql/x.x/main/pg_hba.conf''' (replace x.x with your postgres version)
Line 104: Line 107:
 
ALTER USER dolibarrowner WITH CREATEROLE;
 
ALTER USER dolibarrowner WITH CREATEROLE;
 
\du
 
\du
 +
\q
 
exit
 
exit
 
sudo /etc/init.d/postgresql restart
 
sudo /etc/init.d/postgresql restart
Line 109: Line 113:
 
You can test a connection with this user with command
 
You can test a connection with this user with command
 
<source lang="bash">
 
<source lang="bash">
psql -d postgres -U dolibarrowner -W
+
psql -h localhost -p 5432 -d postgres -U dolibarrowner -W
 +
\du
 +
\l
 
</source>
 
</source>
 
And type your ''dolibarrownerpass'' as password and \q to quit if connection is ok.
 
And type your ''dolibarrownerpass'' as password and \q to quit if connection is ok.
  
 +
====Install Dolibarr files on the web server====
  
==== Install Web server ====
+
*Go into the directory where to install Dolibarr (the web root directory defined for your web server virtual host. Example of setup of virtual host are available on [[Webserver|this page]]).
 
 
*Go into the directory where to install Dolibarr (the web root directory defined for your web server)
 
  
 
#For Debian and Ubuntu families, it is generally: /var/www (newer versions: /var/www/html)
 
#For Debian and Ubuntu families, it is generally: /var/www (newer versions: /var/www/html)
Line 128: Line 133:
 
</source>
 
</source>
  
*Get the application archive of last stable version
+
*Get the application archive of last stable version '''from zip file'''
  
'''from zip file'''
+
For this, see at [https://sourceforge.net/projects/dolibarr/files/Dolibarr%20ERP-CRM/ Sourceforge Mirror] and get the latest stable version url
<source lang="bash">
+
$ wget -O dolibarr.zip https://sourceforge.net/projects/dolibarr/files/Dolibarr%20ERP-CRM/x.y.z/dolibarr-x.y.z.zip/download
$ wget http://www.dolibarr.org/files/dolibarr.zip
 
</source>
 
  
*Uncompress archive
 
  
<source lang="bash">
+
Uncompress archive<source lang="bash">
 
$ unzip dolibarr.zip
 
$ unzip dolibarr.zip
</source>
+
</source> '''or from git repository'''<source lang="bash">
 
 
'''or from git repository'''
 
<source lang="bash">
 
 
$ git clone --depth 1 -b X.Y http://github.com/Dolibarr/dolibarr.git dolibarr
 
$ git clone --depth 1 -b X.Y http://github.com/Dolibarr/dolibarr.git dolibarr
</source>
+
</source> Replace X.Y with the version you want to get. Remove "--depth 1" if you don't mind downloading the entire history of the project (programmers may find it useful but end users probably won't).
Replace X.Y with the version you want to get. Remove "--depth 1" if you don't mind downloading the entire history of the project (programmers may find it useful but end users probably won't).
 
  
*Rename directory dolibarr-x.y.z into dolibarr to have a directory name that does not depends on version (replace x.y.z with source version)
+
*Rename directory dolibarr-x.y.z into dolibarr to have a directory name that does not depends on version (replace x.y.z with source version)<source lang="bash">
 
 
<source lang="bash">
 
 
$ mv dolibarr-x.y.z dolibarr
 
$ mv dolibarr-x.y.z dolibarr
 
</source>
 
</source>
  
*Change permissions and owner of the 'dolibarr' directory to that of the group under which the web server runs (assumed to be 'www-data' for debian, 'apache' for redhat, mandriva, fedora)
+
*Change permissions and owner of the 'dolibarr' directory to that of the group under which the web server runs (assumed to be 'www-data' for debian, 'apache' for redhat, mandriva, fedora)<source lang="bash">
 
 
<source lang="bash">
 
 
$ chmod -R 755 /var/www/dolibarr
 
$ chmod -R 755 /var/www/dolibarr
$ chown -R www-data.www-data /var/www/dolibarr
+
$ chown -R www-data:www-data /var/www/dolibarr
 
or
 
or
 
$ chmod -R 755 /var/www/html/dolibarr
 
$ chmod -R 755 /var/www/html/dolibarr
$ chown -R apache.apache /var/www/html/dolibarr
+
$ chown -R apache:apache /var/www/html/dolibarr
 
</source>
 
</source>
  
*For Fedora, since SELinux is usually enabled, it is also advisable to run the following commands to make the 'dolibarr' directory compliant with the SELinux requirement (else you are likely to get quite a few alerts) :
+
*For Fedora, since SELinux is usually enabled, it is also advisable to run the following commands to make the 'dolibarr' directory compliant with the SELinux requirement (else you are likely to get quite a few alerts) :<source lang="bash">
 
 
<source lang="bash">
 
 
$ semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/dolibarr(/.*)?'
 
$ semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/dolibarr(/.*)?'
 
$ restorecon -R -v '/var/www/html/dolibarr'
 
$ restorecon -R -v '/var/www/html/dolibarr'
 
</source>
 
</source>
  
*As a root user, create, into directory dolibarr/htdocs/conf, an empty configuration file called conf.php and set the web server user as owner (for instance www-data on Debian, apache on Mandriva, RedHat, Fedora or other distributions ...). This is required because the web server will have to write into this file during install process.
+
*As a root user, create, into directory dolibarr/htdocs/conf, an empty configuration file called conf.php and set the web server user as owner (for instance www-data on Debian, apache on Mandriva, RedHat, Fedora or other distributions ...). This is required because the web server will have to write into this file during install process.<source lang="bash">
 
 
<source lang="bash">
 
 
$ cd dolibarr ; touch htdocs/conf/conf.php ; chown www-data htdocs/conf/conf.php
 
$ cd dolibarr ; touch htdocs/conf/conf.php ; chown www-data htdocs/conf/conf.php
</source>
+
</source> Note: For Ubuntu no need of htdocs, you just have to make dolibarr root by placing all files and folders of htdocs in /var/www/dolibarr then from browser do <MyIP>/dolibarr/index.php (see this discussion as reference to this addendum [http://askubuntu.com/questions/874456/php-code-displays-in-browser?noredirect=1#comment1357943_874456])
Note: For Ubuntu no need of htdocs, you just have to make dolibarr root by placing all files and folders of htdocs in /var/www/dolibarr then from browser do <MyIP>/dolibarr/index.php (see this discussion as reference to this addendum [http://askubuntu.com/questions/874456/php-code-displays-in-browser?noredirect=1#comment1357943_874456])
 
  
*As a root user, create a directory that will be used to save all files generated and stocked by Dolibarr (PDf invoices, uploaded images, ...), and attribute to this directory a owner that must be the web server (example www-data on Debian, apache on Mandriva, RedHat, Fedora...). The web server must have write permission into this directory. It is recommended to use a directory outside of your directory of web pages, for example - "/var/lib/dolibarr/documents"
+
*As a root user, create a directory that will be used to save all files generated and stocked by Dolibarr (PDf invoices, uploaded images, ...), and attribute to this directory a owner that must be the web server (example www-data on Debian, apache on Mandriva, RedHat, Fedora...). The web server must have write permission into this directory. It is recommended to use a directory outside of your directory of web pages, for example - "/var/lib/dolibarr/documents"<source lang="bash">
 
 
<source lang="bash">
 
 
$ mkdir -p /var/lib/dolibarr/documents ; chown www-data /var/lib/dolibarr/documents
 
$ mkdir -p /var/lib/dolibarr/documents ; chown www-data /var/lib/dolibarr/documents
 
</source>
 
</source>
  
*Now call your browser to point to the main page
+
*Now call your browser to point to the main page<source lang="ini">
 
 
<source lang="ini">
 
 
http://127.0.0.1/dolibarr/htdocs/
 
http://127.0.0.1/dolibarr/htdocs/
</source>
+
</source> or if you didn't create the htdocs directory<source lang="ini">
or if you didn't create the htdocs directory
 
<source lang="ini">
 
 
http://127.0.0.1/dolibarr/
 
http://127.0.0.1/dolibarr/
 
</source>
 
</source>
Line 195: Line 178:
 
*Follow instructions of setup steps until end of install process.
 
*Follow instructions of setup steps until end of install process.
  
*For security reason, we recommend, once setup is finished, to create a file install.lock into Dolibarr document directory that only root user can delete. This will lock the call of the install process again (you will have to remove this file for upgrades).
+
*For security reason, we recommend, once setup is finished, to create a file install.lock into Dolibarr document directory that only root user can delete. This will lock the call of the install process again (you will have to remove this file for upgrades). If this is not done, Dolibarr will show you a warning once logged by an administrator user.<source lang="bash">
 
 
If this is not done, Dolibarr will show you a warning once logged by an administrator user.
 
<source lang="bash">
 
 
$ touch /var/lib/dolibarr/documents/install.lock; chmod go-w /var/lib/dolibarr/documents;
 
$ touch /var/lib/dolibarr/documents/install.lock; chmod go-w /var/lib/dolibarr/documents;
 
</source>
 
</source>
  
==On a mutualized Web Hosting Provider (without terminal/SSH access)==
+
 
 +
====Additional information on setting up a Debian or Ubuntu server====
 +
If you are planning to configure a Debian or Ubuntu server for Dolibarr to provide the aforementioned prerequisites, there are detailed step-by-step instructions available in German:
 +
 
 +
*[https://wiki.dolibarr.org/Installieren_und_H%C3%A4rten_von_Dolibarr Installation and hardening] ''(German)''
 +
 
 +
*''[https://wiki.dolibarr.org/ModSecurity_f%C3%BCr_Dolibarr Install ModSecurity für Dolibarr] (German)''
 +
 
 +
 
 +
 
 +
 
 +
==Installation on a shared Web Hosting Provider (without terminal/SSH access)==
 
It is not possible to provide a generic documentation to install Dolibarr on a particular Web hosting provider as this depends on provider.
 
It is not possible to provide a generic documentation to install Dolibarr on a particular Web hosting provider as this depends on provider.
 
In most cases, using the following process should works for most providers:
 
In most cases, using the following process should works for most providers:
  
- '''Prerequisite''': Apache web server, PHP and a database server (MySQL or PostgreSQL) are already running correctly and user/pass (of a new database or root server) is known.
+
- '''Prerequisites''': Apache web server, PHP and a database server (MySQL or PostgreSQL) are already running correctly and user/pass (of a new database or root server) is known.
  
 
- '''Level''': Users with few Web and Database administration knowledge. Knowledge to use a tool (FTP, SFTP) to upload files on the server.
 
- '''Level''': Users with few Web and Database administration knowledge. Knowledge to use a tool (FTP, SFTP) to upload files on the server.
  
*Check that you have an Apache web server, PHP and a database server (MySQL or PostGreSQL) that works correctly.
+
*Check that you have an Apache web server, PHP and a database server (MySQL(recommended) or PostGreSQL) that works correctly.
  
[[File:warning.png]] Warning, check that code page of PHP server and database server are same (utf8 recommended).
+
[[File:warning.png]] Warning, check that code page of PHP server and database server are same (<dfn>utf8_general_c</dfn>i recommended).
  
 
*Check that main root or admin user/password couple for the server is known and works correctly. Ask them to your Web Hosting Provider if unknown.
 
*Check that main root or admin user/password couple for the server is known and works correctly. Ask them to your Web Hosting Provider if unknown.
  
*Get the application archive of last stable version and uncompress it locally.
+
*Get the application archive of last stable version from [https://sourceforge.net/projects/dolibarr/files/Dolibarr&#x20;ERP-CRM/ here] and uncompress it locally.
  
*Upload all content of htdocs directory to your web root directory, for example using FTP in binary mode.
+
*Create a folder named dolibarr inside your web root directory(usually called public_html) and upload all content of htdocs directory to it. You can use an FTP client like [https://filezilla-project.org/download.php?type=client22 Filezilla].
  
 
*Create a directory called "documents" into Dolibarr directory that will serve to save all documents generated and stocked by Dolibarr (PDF invoices, uploaded images, ...). The web server must have write permission into this directory. You can set permissions with your FTP client.
 
*Create a directory called "documents" into Dolibarr directory that will serve to save all documents generated and stocked by Dolibarr (PDF invoices, uploaded images, ...). The web server must have write permission into this directory. You can set permissions with your FTP client.
  
*Now call your browser to point to the main page index.php
+
*Using your browser point to the main page index.php e.g. dolibarr.mydomain.com/index.php
  
 
*Follow instructions of setup steps until end of install process.
 
*Follow instructions of setup steps until end of install process.
  
*For security reason, we recommend, once setup is finished, to create a file install.lock into Dolibarr installed directory. This will lock the call of the install process again (you will have to remove it for upgrades). If this is not done, Dolibarr will show you a warning once logged as an administrator user.
+
*For security reason, it's strongly recommended, once setup is finished, to create a file named '''install.lock''' into documents directory. This will lock the call of the install process again (you will have to remove it for upgrades). If this is not done, Dolibarr will show you a warning once logged as an administrator user.
 +
 
 +
 
  
==On a SaaS or Cloud web hosting provider==
+
<br />
 +
==Installation on a SaaS or Cloud web hosting provider==
 
Dolibarr is also available on a lot of "ready to use" SaaS or Cloud platforms/services that provides preinstalled versions.
 
Dolibarr is also available on a lot of "ready to use" SaaS or Cloud platforms/services that provides preinstalled versions.
  
Line 237: Line 231:
 
See page [[Cloud Solutions]].
 
See page [[Cloud Solutions]].
  
==Using Docker==
+
 
For admins with Docker experience, it is possible to use the docker build files located in the source repo here: https://github.com/Dolibarr/dolibarr/tree/develop/build
+
==Installation using Docker==
 +
===Using the official docker image===
 +
See the README at https://hub.docker.com/r/dolibarr/dolibarr
 +
 
 +
===Building your own docker image===
 +
For admins with Docker experience, it is possible to use the docker build files located in the source repository here: https://github.com/Dolibarr/dolibarr/tree/develop/build
 
  git clone https://github.com/Dolibarr/dolibarr/
 
  git clone https://github.com/Dolibarr/dolibarr/
 
  cd ./dolibarr
 
  cd ./dolibarr
Line 248: Line 247:
  
  
 
+
Read the README carefully. As of version 12+ it recommends to use the built in docker files for development only, while the outside repo: https://hub.docker.com/r/dolibarr/dolibarr is recommended for production environments.
 
 
Read the README carefully. As of version 12+ it recommends to use the built in docker files for development only, while an outside repo: https://hub.docker.com/r/tuxgasy/dolibarr is recommended for production environments.
 
  
 
=Setup=
 
=Setup=
Line 266: Line 263:
  
 
=Upgrade Dolibarr=
 
=Upgrade Dolibarr=
This chapter describe processes to upgrade an existing installation of Dolibarr from an old version to a new one. The process is the same, whatever version you are coming from and version you are going to, but it will differ according to the distribution/operating system you used for your first installation. You should use the same for upgrade.
+
This chapter describes the process to upgrade an existing installation of Dolibarr from an old version to a new one. The process is the same, whatever is the version you are coming from and the version you are going to, but it will differ according to the distribution/operating system you used for your first installation. You should use the same for upgrade.
+
 
 +
 
 +
'''Note''' (optional):
 +
 
 +
It's better to delete old program files before installing the new ones: old files can remain, causing bug and malfunctions.
 +
 
 +
Before deleting, remember to save what you have customized in your installation:
 +
 
 +
*your data (documents folder and database)
 +
*/custom if you have external modules -> be sure your external modules are compatible with the new version before updating !
 +
*/conf/conf.php : main parameter of dolibarr
 +
*your customized models and/or customized php scripts (it's recommended to report your modification in the new files cause yours are based on old version)
 +
 
 +
<br />
 
==[[File:Logo_windows.png]] With DoliWamp (Windows .exe package)==
 
==[[File:Logo_windows.png]] With DoliWamp (Windows .exe package)==
  
Line 275: Line 285:
 
*At the end of the execution, your browser is launched with a page to ask you to run upgrade of your database. Choose the upgrade according to your case.
 
*At the end of the execution, your browser is launched with a page to ask you to run upgrade of your database. Choose the upgrade according to your case.
  
If there is more than one version late, the page in your browser will loop to start again the upgrade wizard as often as required to run upgrade process, version by version, until your reach the new installed version.
+
*If there is more than one version late, the page in your browser will loop to start again the upgrade wizard as often as required to run upgrade process, version by version, until your reach the new installed version.
 +
 
  
 
==[[File:Logo_ubuntu.png]] With DoliDeb (Debian or Ubuntu .deb package)==
 
==[[File:Logo_ubuntu.png]] With DoliDeb (Debian or Ubuntu .deb package)==
Line 282: Line 293:
 
*Process to upgrade using Debian/Ubuntu package is the same as the install process (see previous chapters), so it is as easy as installing a package.
 
*Process to upgrade using Debian/Ubuntu package is the same as the install process (see previous chapters), so it is as easy as installing a package.
  
You can also read page [[Dolibarr for Ubuntu or Debian]].
+
*You can also read page [[Dolibarr for Ubuntu or Debian]].
 +
 
 +
<br />
  
 
==[[File:Logo_rpm.png|40px]] With DoliRpm (Fedora, Redhat, Mandriva, Mageia or OpenSuse .rpm package)==
 
==[[File:Logo_rpm.png|40px]] With DoliRpm (Fedora, Redhat, Mandriva, Mageia or OpenSuse .rpm package)==
Line 289: Line 302:
 
*Process to upgrade using rpm package is the same as the install process, so it is as easy as installing a package (see previous chapters).
 
*Process to upgrade using rpm package is the same as the install process, so it is as easy as installing a package (see previous chapters).
  
 +
<br />
 
==[[File:Gnu.png]] With Dolibarr (standard .zip package or from Git)==
 
==[[File:Gnu.png]] With Dolibarr (standard .zip package or from Git)==
 
This is tutorial to use when using standard distribution for a manual upgrade.
 
This is tutorial to use when using standard distribution for a manual upgrade.
Line 294: Line 308:
 
*First make a backup of your current installation
 
*First make a backup of your current installation
  
*Go into the directory where you installed Dolibarr (it might be the root directory of your web, for example /var/www under Debian)
+
*Go into the directory where you installed Dolibarr (it might be the root directory of your web, for example /var/www under Debian)<source lang="bash">
 
 
<source lang="bash">
 
 
$ cd /var/www
 
$ cd /var/www
 
</source>
 
</source>
Line 302: Line 314:
 
===For installation that used the zip file===
 
===For installation that used the zip file===
  
*Get archive of last version
+
*Get the application archive of last stable version '''from zip file'''
  
<source lang="bash">
+
For this, see at [https://sourceforge.net/projects/dolibarr/files/Dolibarr%20ERP-CRM/ Sourceforge Mirror] and get the latest stable version url
$ wget https://www.dolibarr.org/files/dolibarr.zip
+
$ wget -O dolibarr.zip https://sourceforge.net/projects/dolibarr/files/Dolibarr%20ERP-CRM/x.y.z/dolibarr-x.y.z.zip/download
</source>
 
 
 
*Uncompress the archive
 
  
<source lang="bash">
+
*Uncompress the archive<source lang="bash">
 
$ unzip dolibarr.zip
 
$ unzip dolibarr.zip
 
</source>
 
</source>
  
*Copy all new extracted files (the one uncompressed into directory dolibarr-x.y.z) to the directory where you put your old Dolibarr version. This will overwrite old files with new ones without removing files specifics to your installation (like conf.php file or complementary non official installed modules).
+
*Copy all new extracted files (the one uncompressed into directory dolibarr-x.y.z) to the directory where you put your old Dolibarr version. This will overwrite old files with new ones without removing files specifics to your installation (like conf.php file or complementary non official installed modules).<source lang="bash">
 
 
<source lang="bash">
 
 
$ cp -r dolibarr-x.y.z/* dolibarr
 
$ cp -r dolibarr-x.y.z/* dolibarr
 
</source>
 
</source>
  
*If no error, you can now remove the directory of source files
+
*If no error, you can now remove the directory of source files<source lang="bash">
 
 
<source lang="bash">
 
 
$ rm -fr dolibarr-x.y.z
 
$ rm -fr dolibarr-x.y.z
 
</source>
 
</source>
  
*Now open your Dolibarr in your browser. It should open automatically the install/
+
*Now open your Dolibarr in your browser. It should open automatically the install/ and choose ''Update'' in suggested menu.
  
and choose ''Update'' in suggested menu.
+
===For installation that used GIT===
  
===For installation that used GIT===
+
*If you already cloned the repo simply upgrade by checking out a version tag like so:<source lang="bash">
If you already cloned the repo simply upgrade by checking out a version tag like so:
 
<source lang="bash">
 
 
$ git checkout 13.0
 
$ git checkout 13.0
 
$ git pull origin 13.0
 
$ git pull origin 13.0
 
</source>
 
</source>
  
*Now open your Dolibarr in your browser. It should open automatically the install/
+
*Now open your Dolibarr in your browser. It should open automatically the install/ page. Choose ''Update'' in the suggested options.
  
and choose ''Update'' in suggested menu.
+
==Notes on the Upgrade==
  
 +
*If you have a message that tell the install process is locked by a file, remove the file install.lock stored in Dolibarr root directory.
  
 +
*'''For security reasons''', once setup is finished, you should create a file install.lock into Dolibarr documents directory. This will lock the call of the install process again (you will have to remove this file for future upgrades). If this is not done, Dolibarr will show you a warning once logged with an administrator user.<source lang="bash">
 +
$ echo > documents/install.lock
 +
$ chmod 444 documents/install.lock
 +
</source>
  
Note:
+
*If you want to script the database upgrade process (to avoid the upgrade process from web browser), you can run the 3 upgrade processes from command line:<source lang="bash">
 
 
If you want to script the database upgrade process (to avoid the upgrade process from web browser), you can run the 3 upgrade processes from command line:
 
<source lang="bash">
 
 
$ cd htdocs/install
 
$ cd htdocs/install
 
$ php upgrade.php oldx.oldy.oldz x.y.z > output.html
 
$ php upgrade.php oldx.oldy.oldz x.y.z > output.html
 
$ php upgrade2.php oldx.oldy.oldz x.y.z > output2.html
 
$ php upgrade2.php oldx.oldy.oldz x.y.z > output2.html
 
$ php step5.php oldx.oldy.oldz x.y.z > output3.html
 
$ php step5.php oldx.oldy.oldz x.y.z > output3.html
</source>
+
</source> Note: z must be "0" because only major versions have a migration script to run. Return code will be 0 if success, 1 if error (if this happens, see file output.html, output2.html or output3.html).
Note: z must be "0" because only major versions have a migration script to run.
+
 
 +
=Related videos=
 +
Install on local :
 +
(vocal in french but subtitles are available and review in this language)
 +
 
 +
<youtube width="200" height="120">N0iweN8ukVU</youtube>
  
Return code will be 0 if success, 1 if error (if this happens, see file output.html, output2.html or output3.html).
+
Install on server Infomaniak :
 +
(vocal in french but subtitles are available and review in this language)
  
Note: If you have a message that tell the install process is locked by a file, remove the file install.lock stored in Dolibarr root directory.
+
<youtube width="200" height="120">jsi1D4L1WAI</youtube>
  
*For security reason, once setup is finished, you should create a file install.lock into Dolibarr documents directory. This will lock the call of the install process again (you will have to remove this file for future upgrades). If this is not done, Dolibarr will show you a warning once logged with an administrator user.
+
Installation and migration to V15 on local :
 +
(vocal in french but subtitles are available and review in this language)
  
<source lang="bash">
+
<youtube width="200" height="120">LKdQvRVxYKs</youtube>
$ echo > documents/install.lock
 
$ chmod 444 documents/install.lock
 
</source>
 

Latest revision as of 17:20, 7 January 2025


The following documentation describes processes to install or upgrade Dolibarr on a Windows, MAC OS or Unix like platform.


Install Dolibarr

This chapter describe different available methods to install Dolibarr for the first time (from the most simple to the manual one). See next chapter for upgrades.

Installation on your dedicated computer/server (installation "On Premise")

Logo windows.png Manually or with DoliWamp

- Prerequisite: Windows

- Level: Non experienced users

This process works only for Windows users and is recommended for user with no computer knowledge. If you have experience with Apache, PHP and Mysql installation, next chapter is better for you.

If you have time and want to learn how to install an Apache, PHP and MariaDB web server, see the Manual installation on Windows page for step-by-step instructions.

However, if you are a newbie user and running Windows, you can use DoliWamp. DoliWamp is a specialized Dolibarr distribution for Windows. This distribution allows you to make an installation under Windows with all prerequisites (Apache, Mysql, PHP) and with no computer knowledge. This is steps to install DoliWamp:

  • Download last Dolibarr version for Windows DoliWamp.

For this, see at Sourceforge mirror

  • Run the downloaded .exe and follow instructions.


Logo ubuntu.png With DoliDeb (Debian or Ubuntu .deb package)

- Prerequisite: Linux Ubuntu

- Level: Non experienced users

This process works only for Ubuntu or Debian Linux users and is recommended for user with little computer knowledge. If you are experienced with Apache, PHP and Mysql installation, the chapter 'with standard package' is better for you. However, if you are a newbie user and running Ubuntu, you can use DoliDeb. DoliDeb is a specialized Dolibarr distribution for Debian or Ubuntu. This distribution allows you to make an installation under Ubuntu with all prerequisites (Apache, Mysql, PHP) and with no computer knowledge.


Logo rpm.png With DoliRpm (Fedora, Redhat, Mandriva, Mageia or OpenSuse .rpm package)

- Prerequisite: Linux Fedora, Redhat, Mandriva, Mageia or OpenSuse

- Level: Non experienced users

This process works only for Fedora, Redhat, Mandriva, Mageia or OpenSuse Linux users and is recommended for user with no computer knowledge. If you have experience with Apache, PHP and Mysql installation, next chapter 'with standard package' is better for you. However, if you are a newbie user and running Fedora or Redhat, you can use DoliRpm. DoliRpm is a specialized Dolibarr distribution for Fedora, Redhat or Mandriva. This distribution allows you to make an installation under such OS with all prerequisites (Apache, Mysql, PHP) and with no computer knowledge.


Gnu.png With Dolibarr (standard .zip package or from git)

- Prerequisite: Apache, PHP and a database server (MySQL or PostgreSQL) are already running correctly and user/pass (of a new database or root server) is known.

- Level: Users with few Web and Database administration knowledge.

This procedure describe manual (and recommended) installation on a GNU/Linux system (Debian, Mandriva, ...), it can be used for other OS with minor changes. You can follow this tutorial for any Dolibarr version >= 2.0.0

  • Check that you have installed Apache, PHP 7.1.0+ and a database server (MySQL 5.1+ or PostGreSQL) correctly (check list of installed packaged on your server by using the package manager of your distribution). If not, install them (use last recent version).
  • Check that main root or admin user/password couple for the server is known and works correctly. If this root or admin user/password is not known because not yet defined, read following chapter. Otherwise go on next step:
Preparation of MySQL or MariaDB database

For Linux users, if you have just installed a MySQL or MariaDB server, the admin user is root. If the root password has never been set yet, you must run the following command to initialize the password:

mysql

Once in Mysql interface, run the SQL command to modify the root password:

grant all privileges on *.* to root@'localhost' identified by 'newrootpass' with grant option;

Then enter and \q to quit.

To check that the connection with the new couple user/password works, launch the command

mysql -u root -p

And type your password newrootpass then \q to quit if the connection has been successful.

Preparation of PostgreSQL database

For Linux users, if you have just installed a PostgreSQL server, you must run the following command to initialize an admin user and password. For this, add the following line in file /etc/postgresql/x.x/main/pg_hba.conf (replace x.x with your postgres version)

local   all         dolibarrowner    md5

Also, comment the line

#local   all         all                               ident

This line ensure that system login used to connect to database (it will be login the web server run with), is same than database account (this is never the case).

Then launch commands from a root shell

sudo -s -u postgres
createuser dolibarrowner
psql -U postgres -d template1
alter user dolibarrowner with password 'dolibarrownerpass';
ALTER USER dolibarrowner WITH SUPERUSER;
ALTER USER dolibarrowner WITH CREATEDB;
ALTER USER dolibarrowner WITH CREATEROLE;
\du
\q
exit
sudo /etc/init.d/postgresql restart

You can test a connection with this user with command

psql -h localhost -p 5432 -d postgres -U dolibarrowner -W
\du
\l

And type your dolibarrownerpass as password and \q to quit if connection is ok.

Install Dolibarr files on the web server
  • Go into the directory where to install Dolibarr (the web root directory defined for your web server virtual host. Example of setup of virtual host are available on this page).
  1. For Debian and Ubuntu families, it is generally: /var/www (newer versions: /var/www/html)
  2. For Mandriva, RedHat, Fedora: /var/www/html
  3. For Suse: /srv/www/htdocs
$ cd /var/www
or
$ cd /var/www/html
  • Get the application archive of last stable version from zip file

For this, see at Sourceforge Mirror and get the latest stable version url

$ wget -O dolibarr.zip https://sourceforge.net/projects/dolibarr/files/Dolibarr%20ERP-CRM/x.y.z/dolibarr-x.y.z.zip/download


Uncompress archive

$ unzip dolibarr.zip

or from git repository

$ git clone --depth 1 -b X.Y http://github.com/Dolibarr/dolibarr.git dolibarr

Replace X.Y with the version you want to get. Remove "--depth 1" if you don't mind downloading the entire history of the project (programmers may find it useful but end users probably won't).

  • Rename directory dolibarr-x.y.z into dolibarr to have a directory name that does not depends on version (replace x.y.z with source version)
    $ mv dolibarr-x.y.z dolibarr
    
  • Change permissions and owner of the 'dolibarr' directory to that of the group under which the web server runs (assumed to be 'www-data' for debian, 'apache' for redhat, mandriva, fedora)
    $ chmod -R 755 /var/www/dolibarr
    $ chown -R www-data:www-data /var/www/dolibarr
    or
    $ chmod -R 755 /var/www/html/dolibarr
    $ chown -R apache:apache /var/www/html/dolibarr
    
  • For Fedora, since SELinux is usually enabled, it is also advisable to run the following commands to make the 'dolibarr' directory compliant with the SELinux requirement (else you are likely to get quite a few alerts) :
    $ semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/dolibarr(/.*)?'
    $ restorecon -R -v '/var/www/html/dolibarr'
    
  • As a root user, create, into directory dolibarr/htdocs/conf, an empty configuration file called conf.php and set the web server user as owner (for instance www-data on Debian, apache on Mandriva, RedHat, Fedora or other distributions ...). This is required because the web server will have to write into this file during install process.
    $ cd dolibarr ; touch htdocs/conf/conf.php ; chown www-data htdocs/conf/conf.php
    
    Note: For Ubuntu no need of htdocs, you just have to make dolibarr root by placing all files and folders of htdocs in /var/www/dolibarr then from browser do <MyIP>/dolibarr/index.php (see this discussion as reference to this addendum [1])
  • As a root user, create a directory that will be used to save all files generated and stocked by Dolibarr (PDf invoices, uploaded images, ...), and attribute to this directory a owner that must be the web server (example www-data on Debian, apache on Mandriva, RedHat, Fedora...). The web server must have write permission into this directory. It is recommended to use a directory outside of your directory of web pages, for example - "/var/lib/dolibarr/documents"
    $ mkdir -p /var/lib/dolibarr/documents ; chown www-data /var/lib/dolibarr/documents
    
  • Now call your browser to point to the main page
    http://127.0.0.1/dolibarr/htdocs/
    
    or if you didn't create the htdocs directory
    http://127.0.0.1/dolibarr/
    
  • Follow instructions of setup steps until end of install process.
  • For security reason, we recommend, once setup is finished, to create a file install.lock into Dolibarr document directory that only root user can delete. This will lock the call of the install process again (you will have to remove this file for upgrades). If this is not done, Dolibarr will show you a warning once logged by an administrator user.
    $ touch /var/lib/dolibarr/documents/install.lock; chmod go-w /var/lib/dolibarr/documents;
    


Additional information on setting up a Debian or Ubuntu server

If you are planning to configure a Debian or Ubuntu server for Dolibarr to provide the aforementioned prerequisites, there are detailed step-by-step instructions available in German:



Installation on a shared Web Hosting Provider (without terminal/SSH access)

It is not possible to provide a generic documentation to install Dolibarr on a particular Web hosting provider as this depends on provider. In most cases, using the following process should works for most providers:

- Prerequisites: Apache web server, PHP and a database server (MySQL or PostgreSQL) are already running correctly and user/pass (of a new database or root server) is known.

- Level: Users with few Web and Database administration knowledge. Knowledge to use a tool (FTP, SFTP) to upload files on the server.

  • Check that you have an Apache web server, PHP and a database server (MySQL(recommended) or PostGreSQL) that works correctly.

Warning.png Warning, check that code page of PHP server and database server are same (utf8_general_ci recommended).

  • Check that main root or admin user/password couple for the server is known and works correctly. Ask them to your Web Hosting Provider if unknown.
  • Get the application archive of last stable version from here and uncompress it locally.
  • Create a folder named dolibarr inside your web root directory(usually called public_html) and upload all content of htdocs directory to it. You can use an FTP client like Filezilla.
  • Create a directory called "documents" into Dolibarr directory that will serve to save all documents generated and stocked by Dolibarr (PDF invoices, uploaded images, ...). The web server must have write permission into this directory. You can set permissions with your FTP client.
  • Using your browser point to the main page index.php e.g. dolibarr.mydomain.com/index.php
  • Follow instructions of setup steps until end of install process.
  • For security reason, it's strongly recommended, once setup is finished, to create a file named install.lock into documents directory. This will lock the call of the install process again (you will have to remove it for upgrades). If this is not done, Dolibarr will show you a warning once logged as an administrator user.



Installation on a SaaS or Cloud web hosting provider

Dolibarr is also available on a lot of "ready to use" SaaS or Cloud platforms/services that provides preinstalled versions.

See page Cloud Solutions.

Dolibarr can also be installed manually on all Cloud platforms that support PHP and Mysql.

See page Cloud Solutions.


Installation using Docker

Using the official docker image

See the README at https://hub.docker.com/r/dolibarr/dolibarr

Building your own docker image

For admins with Docker experience, it is possible to use the docker build files located in the source repository here: https://github.com/Dolibarr/dolibarr/tree/develop/build

git clone https://github.com/Dolibarr/dolibarr/
cd ./dolibarr
git checkout tags/<desiredrelease>
cd build/docker
docker-compose up


Read the README carefully. As of version 12+ it recommends to use the built in docker files for development only, while the outside repo: https://hub.docker.com/r/dolibarr/dolibarr is recommended for production environments.

Setup

First setup

See page Setup.

Setup a LDAP connection

If you want to use a LDAP: See Install and configure OpenLDAP.


Import external data

For this operation, read page Mass imports.


Upgrade Dolibarr

This chapter describes the process to upgrade an existing installation of Dolibarr from an old version to a new one. The process is the same, whatever is the version you are coming from and the version you are going to, but it will differ according to the distribution/operating system you used for your first installation. You should use the same for upgrade.


Note (optional):

It's better to delete old program files before installing the new ones: old files can remain, causing bug and malfunctions.

Before deleting, remember to save what you have customized in your installation:

  • your data (documents folder and database)
  • /custom if you have external modules -> be sure your external modules are compatible with the new version before updating !
  • /conf/conf.php : main parameter of dolibarr
  • your customized models and/or customized php scripts (it's recommended to report your modification in the new files cause yours are based on old version)


Logo windows.png With DoliWamp (Windows .exe package)

  • First make a backup of your current installation
  • Download new .exe package of DoliWamp.
  • Run downloaded .exe file and follow steps without changing any default values. This will upgrades all your files.
  • At the end of the execution, your browser is launched with a page to ask you to run upgrade of your database. Choose the upgrade according to your case.
  • If there is more than one version late, the page in your browser will loop to start again the upgrade wizard as often as required to run upgrade process, version by version, until your reach the new installed version.


Logo ubuntu.png With DoliDeb (Debian or Ubuntu .deb package)

  • First make a backup of your current installation
  • Process to upgrade using Debian/Ubuntu package is the same as the install process (see previous chapters), so it is as easy as installing a package.


Logo rpm.png With DoliRpm (Fedora, Redhat, Mandriva, Mageia or OpenSuse .rpm package)

  • First make a backup of your current installation
  • Process to upgrade using rpm package is the same as the install process, so it is as easy as installing a package (see previous chapters).


Gnu.png With Dolibarr (standard .zip package or from Git)

This is tutorial to use when using standard distribution for a manual upgrade.

  • First make a backup of your current installation
  • Go into the directory where you installed Dolibarr (it might be the root directory of your web, for example /var/www under Debian)
    $ cd /var/www
    

For installation that used the zip file

  • Get the application archive of last stable version from zip file

For this, see at Sourceforge Mirror and get the latest stable version url

$ wget -O dolibarr.zip https://sourceforge.net/projects/dolibarr/files/Dolibarr%20ERP-CRM/x.y.z/dolibarr-x.y.z.zip/download
  • Uncompress the archive
    $ unzip dolibarr.zip
    
  • Copy all new extracted files (the one uncompressed into directory dolibarr-x.y.z) to the directory where you put your old Dolibarr version. This will overwrite old files with new ones without removing files specifics to your installation (like conf.php file or complementary non official installed modules).
    $ cp -r dolibarr-x.y.z/* dolibarr
    
  • If no error, you can now remove the directory of source files
    $ rm -fr dolibarr-x.y.z
    
  • Now open your Dolibarr in your browser. It should open automatically the install/ and choose Update in suggested menu.

For installation that used GIT

  • If you already cloned the repo simply upgrade by checking out a version tag like so:
    $ git checkout 13.0
    $ git pull origin 13.0
    
  • Now open your Dolibarr in your browser. It should open automatically the install/ page. Choose Update in the suggested options.

Notes on the Upgrade

  • If you have a message that tell the install process is locked by a file, remove the file install.lock stored in Dolibarr root directory.
  • For security reasons, once setup is finished, you should create a file install.lock into Dolibarr documents directory. This will lock the call of the install process again (you will have to remove this file for future upgrades). If this is not done, Dolibarr will show you a warning once logged with an administrator user.
    $ echo > documents/install.lock
    $ chmod 444 documents/install.lock
    
  • If you want to script the database upgrade process (to avoid the upgrade process from web browser), you can run the 3 upgrade processes from command line:
    $ cd htdocs/install
    $ php upgrade.php oldx.oldy.oldz x.y.z > output.html
    $ php upgrade2.php oldx.oldy.oldz x.y.z > output2.html
    $ php step5.php oldx.oldy.oldz x.y.z > output3.html
    
    Note: z must be "0" because only major versions have a migration script to run. Return code will be 0 if success, 1 if error (if this happens, see file output.html, output2.html or output3.html).

Related videos

Install on local : (vocal in french but subtitles are available and review in this language)

Install on server Infomaniak : (vocal in french but subtitles are available and review in this language)

Installation and migration to V15 on local : (vocal in french but subtitles are available and review in this language)