Installing and configuring Odoo on DigitalOcean

In this tutorial I will teach you how to install Odoo on a new DigitalOcean VPS. You will learn how to create a new account, create a new server (droplet) and how to install any Odoo version on it.
In this tutorial I will show you step by step how to create the server and how to install the Odoo thanks to my installation scripts.

1. Creating a DigitalOcean account

If you do not have a DigitalOcean account yet you should create one. If you do you can continue to chapter 2. You can create a new DigitalOcean account through this link, which will give you $10 for free to start with. After clicking on this link you will see the following screen:
DigitalOcean website
Simply click on the link, fill in an e-mailadress and a password and click on “Sign Up”. After doing so you’ll get an e-mail in your inbox. Open up the link in your e-mail and your account will be activated.

2. Creating a new server (droplet)

Now that you have an account it is time to create a VPS. DigitalOcean calls a VPS (or a server) a droplet. When you’re on the home screen after logging in you’ll see a button “Create”. After you click on this button you will see a dropdown that has an option called “Droplets“, click on it:
Create droplet button
After clicking on the button a new page will show up asking which OS you want to use and what specifications (with their prices) you’d like:
Droplet configuration

For this tutorial I will create an Ubuntu 16.04.3 droplet (VPS) with 2GB RAM, 2 CPU’s and 40GB storage. This will cost $20 per month at the time of writing. Choosing what server you need is up to you and depends on your requirements. Do know that a server with less than 1GB of RAM will not work out. Finally you will see some additional options, the ability to add an SSH key and to name your droplet (VPS) as you’d like:
Droplet configuration
I’d advice you to check on “Monitoring” as it has no extra costs but it allows you to configure warnings. For more information about monitoring you should read this article from DigitalOcean.
Now give your droplet (VPS) a name and click on the “Create” button. A few seconds later you will see that the droplet (VPS) is being created:
Droplet creation page
That’s it! You’ve just created a new droplet and are ready to connect with it.

3. Connecting with the DigitalOcean droplet (VPS)

Because you’ve just created a new droplet (VPS) you’ve gotten an e-mail in your inbox. Open up your mailbox and you will find an e-mail with all the information you need to connect to the remote server:
Droplet connection details

You can now SSH to the server with these details in order to configure the server and install Odoo. You can connect by using the Linux command ‘ssh’, which looks like this:

SSH tells Linux that you want to open up a secure connection, root is the username of the user you’re connecting with and 138.68.95.197 is the IP of the server.
After entering this command you will get the question if you’re sure to continue connecting, just type yes. Now you’ll need to enter the password that is inside the e-mail you’ve recieved from DigitalOcean. Finally the server will ask you your current password and a new one, in order to change your automatically generated password to a safer one. Go ahead and change your password, after doing so you’re good to go:
SSH connection

4. Installing Odoo

That wasn’t too bad right? Now there is just one more thing to do: install Odoo on the server!
In order to install Odoo on the server you can use my installation script, which does a lot of the installation automatically. You can find an installation script for every Odoo version on Github. In this example I will install Odoo 10, but you’re free to install any other version.

4.1 DOWNLOADING THE INSTALLATION SCRIPT

  • If you want to install Odoo 10 you can run the following command:
  • If you want to install Odoo 9 you can run the following command:
  • If you want to install Odoo 8 you can run the following command:

As a result you will get a new file (named ‘odoo_install.sh’) on your system which contains all the code to install Odoo:
Download installation script

4.2 CONFIGURING THE INSTALLATION SCRIPT

Now open up the file and edit the parameters to your liking:

There are some things you can configure/change to your likings at the top of the script. You can choose if you wish to install Wkhtmltopdf or not, which version you’d like, where the location is and most importantly what the master admin password is.
Tip: always modify this for every Odoo you install!
If you want the enterprise version of V10 you should change the line IS_ENTERPRISE to true:

If you want the community version you can just continue and keep the IS_ENTERPRISE key on False (which is the case by default):

4.3 MAKING THE ODOO INSTALLATION FILE EXECUTABLE

The next step is to make this file executable. After you’ve made it executable you can execute it and everything will be installed automatically.
You can do this with the following command:

4.4 RUNNING THE INSTALLATION SCRIPT

Now that the code is in your file and the file is executable you simply have to execute it with the following command:

You will see that the script automatically starts updates, downloads required packages, creates the user, downloads the code from Github, … Eventually, if you’ve chosen to install the enterprise version, you will need to give in your Github credentials to download the Enterprise code (since this is a private repository). Fill in your details and let the script continue:
Enterprise authentication
Finally, give the script a few minutes to configure and install everything and eventually you will see something like this:
Result installation script

You now have a fully functional Odoo on your system! Congratulations.

4.5 ACCESSING YOUR ODOO

Good job! You’ve created a DigitalOcean account, created a droplet (VPS), configured it and installed Odoo on it. Now it is time to enjoy the results of your hard work. If you now open up your browser and surf to your IP and the port you’ve installed Odoo on (by default 8069) you can see your Odoo is up and running. Because the droplet (VPS) is automatically connected to the internet (a public IP address) your Odoo will also be publicly available. Go to http://yourip:yourport and you will see your just installed Odoo:
Public Odoo page

4.6 SECURITY ADVISORY

As security is a very big topic I did not add anything about security in this tutorial. Please do configure your Odoo with a firewall, Nginx, SSL and best security practices. The security part is out of scope in this tutorial because of the size of the subject but please do add in security rules.
For more information please do look at Nginxthe official DigitalOcean security measures and LetsEncrypt.

5. Conclusion

Creating a new server, configuring it and installing an Odoo on it is very easy with DigitalOcean. You’ll have a VPS in a matter of minutes for an affordable price. Due to the accessibility and flexibility of DigitalOcean and Odoo it has never been so easy to have an ERP publicly available.

Has this tutorial helped you, do you have any feedback or questions? Post away!


ทิ้งคำตอบไว้

This site uses Akismet to reduce spam. Learn how your comment data is processed.