<\/span><\/h2>\nWe 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>\nCreate 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>\nNginx 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>\nDebian 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>\nAt 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>\nExtract 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