<\/p>\n
In this tutorial, we will show you how to install Dolibarr on your Debian 9 VPS<\/a>.<\/p>\n
Table of Contents<\/p>\n
Connect to your server via SSH as the root user (or as an admin account) by using the ‘ssh’ command:<\/p>\n
ssh root@IP_ADDRESS<\/span> -p PORT_NUMBER<\/span><\/pre>\nRemember to replace \u201cIP_ADDRESS<\/span>\u201d and \u201cPORT_NUMBER<\/span>\u201d with your server’s actual IP address and SSH port number. Replace \u201croot\u201d with your admin username if you\u2019re not planning on using the root account.<\/p>\n
Before starting with the installation, we need to update the OS packages to their latest versions.<\/p>\n
We can do this by running the following commands:<\/p>\n
$ apt-get update \r\n$ apt-get upgrade<\/pre>\nOnce the upgrade is complete, we can move on to the next step.<\/p>\n
<\/span>Step 2: Install MariaDB<\/span><\/h2>\n
We will use MariaDB (an open-source version of MySQL) as our database engine. We can install MariaDB server from the Debian 9 base repository through the following command:<\/p>\n
$ apt-get install mariadb-server-10.1 mariadb-server-core-10.1<\/pre>\nIf desired, you can further improve the security of your MariaDB server by running a command that will prompt you through some security settings.<\/p>\n
$ mysql_secure_installation<\/pre>\nTo start, if\/when the program asks for your current MySQL root password, just press the [Enter] key once, as no password is set by default.\u00a0We suggest answering every following question with the character \u2018Y\u2019 for yes.<\/p>\n
<\/span>Step 3: Create a Database for <\/span>Dolibarr<\/span><\/span><\/h2>\n
Create a MySQL database for the Dolibarr website. If you performed the optional secure_installation step, you will need to log in using your newly-set MySQL password. If not, log in by pressing the [Enter] key once when prompted for a password, as no password is set by default:<\/p>\n
$ mysql -u root -p<\/pre>\nThen run these next lines to create a database, a new user, as well as assign full privileges for the database to that new user:<\/p>\n
MariaDB [(none)]> CREATE DATABASE dolibarr character set UTF8 collate utf8_bin;\r\nMariaDB [(none)]> GRANT ALL PRIVILEGES ON dolibarr.* TO 'dolibarr'@'localhost' IDENTIFIED BY 'Password';\r\nMariaDB [(none)]> FLUSH PRIVILEGES;\r\nMariaDB [(none)]> exit;<\/pre>\nNote:<\/strong>\u00a0Don\u2019t forget to replace \u2018Password\u2019 with an actual strong password.<\/p>\n
<\/span>Step 4: Install Nginx<\/span><\/h2>\n
Nginx is available in the pre-installed Debian package repositories. You can install it with the following command:<\/p>\n
$ apt install nginx<\/pre>\nOnce the installation is complete, Nginx will be automatically started.
\nWe can make sure that the Nginx service is running with the following command:<\/p>\n$ systemctl status nginx<\/pre>\nThe output should look similar to the one found below:<\/p>\n
\u25cf nginx.service - A high performance web server and a reverse proxy server\r\n Loaded: loaded (\/lib\/systemd\/system\/nginx.service; enabled; vendor preset: enabled)\r\n Active: active (running)\r\n Docs: man:nginx(8)\r\n Main PID: 7011 (nginx)\r\n Tasks: 3 (limit: 4915)\r\n CGroup: \/system.slice\/nginx.service\r\n \u251c\u25007011 nginx: master process \/usr\/sbin\/nginx -g daemon on; master_process on;\r\n \u251c\u25007012 nginx: worker process\r\n \u2514\u25007013 nginx: worker process<\/pre>\nIf it all looks to be in order, we can proceed to the next step.<\/p>\n
<\/span>Step 5: Install PHP<\/span><\/h2>\n
Debian 9 comes with PHP 7.0 by default. We will also include some additional modules in order to help PHP connect to our Nginx and database servers. On top of these, we will also install modules that are required by Dolibarr.<\/p>\n
To do this, type the following command and confirm the install:<\/p>\n
$ apt-get install php7.0 php7.0-cli php7.0-common php7.0-curl php7.0-gd php7.0-intl php7.0-json php7.0-mbstring php7.0-mysql php7.0-soap php7.0-xml php7.0-xmlrpc php7.0-zip php7.0-fpm<\/pre>\n<\/span>Step 6: Install Dolibarr<\/span><\/h2>\n
At the time of writing this tutorial, the latest stable version is Dolibarr 9.0.3. Download the latest stable version of Dolibarr to the
\/var\/www\/html<\/code> directory. The download link has been added to the command for you:<\/p>\n
$ cd \/var\/www\/html\r\n$ wget https:\/\/sourceforge.net\/projects\/dolibarr\/files\/Dolibarr%20ERP-CRM\/9.0.3\/dolibarr-9.0.3.tgz\/download -O dolibarr.tgz<\/pre>\n
Extract the ‘dolibarr.tgz’ archive and rename the directory:<\/p>\n
$ tar xvf dolibarr.tgz\r\n$ mv dolibarr-* dolibarr<\/pre>\nChange the permissions of the files and directories inside the
\/var\/www\/html\/dolibarr<\/code> directory so the web server user (www-data) can access them:<\/p>\n
$ chown www-data: -R \/var\/www\/html\/dolibarr<\/pre>\n
<\/span>Step 7: Configure Nginx<\/span><\/h2>\n
This step is only necessary if you wish to access your Dolibarr instance using a domain name instead of an IP address.<\/p>\n
Create a new server block with the following content by creating a file in the directory
\/etc\/nginx\/sites-available<\/code>. We’re using ‘nano’ as our text editor in this tutorial – you are free to use your preferred text editor instead.<\/p>\n
Remember to replace ‘your_domain.com<\/span>‘ with your registered domain name:<\/p>\n
$ nano \/etc\/nginx\/sites-available\/your_domain.com<\/span>.conf<\/pre>\n
server {\r\n listen 80;\r\n listen [::]:80;\r\n root \/var\/www\/html\/dolibarr\/htdocs;\r\n index index.php index.html index.htm;\r\n server_name your_domain.com<\/span> www.your_domain.com<\/span>;\r\n\r\n client_max_body_size 100M;\r\n\r\n location ~ ^\/api\/(?!(index\\.php))(.*) {\r\n try_files $uri \/api\/index.php\/$2?$query_string;\r\n }\r\n\r\n location ~ [^\/]\\.php(\/|$) {\r\n include snippets\/fastcgi-php.conf;\r\n if (!-f $document_root$fastcgi_script_name) {\r\n return 404;\r\n }\r\n fastcgi_pass unix:\/var\/run\/php\/php7.0-fpm.sock;\r\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n }\r\n\r\n}<\/pre>\n
Once you are done, save the file and close it.<\/p>\n
Activate the server block by creating a symbolic link to the ‘sites-enabled’ directory:<\/p>\n
$ ln -s \/etc\/nginx\/sites-available\/your_domain.com<\/span>.conf \/etc\/nginx\/sites-enabled\/your_domain.com<\/span>.conf<\/pre>\n
Check if there are any syntax errors present in the Nginx configuration by using the command below:<\/p>\n
$ nginx -t<\/pre>\nIf everything is OK with the configuration, the output should be similar to the one below:<\/p>\n
$ nginx -t\r\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\r\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful<\/pre>\n<\/span>Step 8: Installing Dolibarr Using the Web Interface<\/span><\/h2>\n
You can now navigate to
http:\/\/your_domain.com<\/code>\u00a0(or to your IP address) in your browser to start the Dolibarr installation wizard.<\/p>\n
<\/p>\n
On the next page, you will need to enter your database information (username, database name, and password)<\/span><\/span><\/p>\n
<\/p>\n
Here you’ll get to pick the username and password that you wish to use to log into your Dolibarr environment.<\/p>\n
<\/p>\n
Once the user has been created successfully, You should see the following page:<\/p>\n
<\/p>\n
With this step, Dolibarr installation is completed. You can now visit
http:\/\/your_domain.com<\/code>\u00a0(or your IP address) and log in to your Dolibarr instance using the credentials that you created in one of the installation steps.<\/p>\n
<\/p>\n
Click on Company\/Organization<\/strong> and enter the Details of your company, then go to Modules\/Applications<\/strong> and select which Modules you want to use. You can now access your admin panel:<\/p>\n
<\/p>\n
That\u2019s it! Dolibarr has been successfully installed on your Debian 9 server.<\/p>\n
\n
Of course, you don\u2019t have to install Dolibarr on Debian 9<\/a>\u00a0if you use one of our Linux VPS Hosting plans,<\/a> in which case you can simply ask our expert Linux admins to set up Dolibarr for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n