Installation - Upgrade

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.

[[File:Logo_windows.png]] With DoliWamp (Windows .exe package)
- Prerequisite: Windows

- Level: Non experienced users

This process works only for Windows users and is recommended for user with no computer knowledges. If you are experimented with Apache, PHP and Mysql installation, next chapter is better for you. 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:

For this, see page download DoliWamp on NLTechno web site.
 * Download last Dolibarr version for Windows DoliWamp.


 * Run the downloaded .exe and follow instructions.

[[File: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 no computer knowledges. If you are experimented with Apache, PHP and Mysql installation, chapter 'with standard pakcage' 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.

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 knowledges. If you are experimented 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).

[[File:Gnu.png]] With Dolibarr (standard .tgz package)
- 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 knowledges.

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 and a database server (MySQL  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:

For Linux users, if you have just installed a MySQL 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: Once in Mysql interface, run the SQL command to modify the root password: Then enter and \q to quit.

To check that connexion with the new couple user/password works, launch the command And type your password newrootpass then \q to quit if connexion has been successfull.

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) Also, comment the line 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 You can test a connection with this user with command And type your dolibarrownerpass as password and \q to quit if connection is ok.


 * Go into the directory where to install Dolibarr (the web root directory defined for your web server)
 * 1) For Debian and Ubuntu families, it is generally: /var/www
 * 2) For Mandriva, RedHat, Fedora: /var/www/html
 * 3) For Suse: /srv/www/htdocs


 * Get the application archive of last stable version
 * Uncompress archive


 * 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)
 * Change permission 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)
 * 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) :


 * As a root user, create, into directory dolibarr/htdocs/conf, an empty configuration file called conf.php and set, as owner, the web server user (example 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 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 recommanded to use a directory outside of your directory of web pages, for example - "/var/lib/dolibarr/documents"


 * Now call your browser to point to the main page


 * Follow instructions of setup steps until end of install process.

If this is not done, Dolibarr will show you a warning once logged by an administrator user.
 * For security reason, we recommend, once setup is finished, to create a file install.lock into Dolibarr installed 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).

On a mutualized Web Hosting Provider (with restricted 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:

- 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.

- Level: Users with few Web and Database administration knowledges. 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 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.


 * Upload all content of htdocs directory to your web root directory, for example using FTP in binary mode.


 * 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


 * 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.

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.

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

[[File:Logo_windows.png]] With DoliWamp (Windows .exe package)
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.
 * 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.

[[File:Logo_ubuntu.png]] With DoliDeb (Debian or Ubuntu .deb package)
Process to upgrade using Debian/Ubuntu package is same way than install process (see previous chapters), so it is as easy as installing a package. You can also read page Dolibarr for Ubuntu or Debian.

Logo_rpm.png With DoliRpm (Fedora, Redhat, Mandriva, Mageia or OpenSuse .rpm package)
Process to upgrade using rpm package is same way than install process, so it is as easy as installing a package (see previous chapters).

[[File:Gnu.png]] With Dolibarr (standard .tgz package)
This is tutorial to use when using standard distribution for a manual upgrade.


 * Go into the directory where you installed Dolibarr (it might be the root directory of your web, for example /var/www under Debian)


 * Get archive of last version


 * Uncompress the archive


 * 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).


 * If no error, you can now remove the directory of source files

and choose Update in suggested menu.
 * Now call the install/ page of Dolibarr in your browser

or

Run the two upgrade processes from command line: 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 or output2.html).

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.


 * 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.

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

= Import external data = For this operation, read page Mass imports.

= Setup = See page Setup.