In our previous articles, we have discussed setting up Odoo on Ubuntu and Windows (using WSL2) for development purposes. What if we need to set up Odoo for production use and also need a simple way to do that? This article will help you with just that. We will take a look at a script that will install Odoo on Ubuntu just by running the script once.
So we will be using the script available over here at GitHub. This script is basically the same as the script by Yenthe, but with some improvements. You are free to use whichever you like since both serve the same purpose. The only thing to note is that we have only tested the script on Ubuntu 18.04 and Ubuntu 20.04, and your mileage with any other distro may vary. Also, only Odoo 14 and Odoo 15 are actively tested, so other versions may also give issues.
To get the script, you can either clone the repo or download the script directly using the below command. Use the correct branch according to the Odoo version you require. In the course of this article, we will be using Odoo 15.
wget https://raw.githubusercontent.com/MihranThalhath/InstallScript/15.0/odoo _install.sh
The above command will download the script to the folder where you ran the command. You can then open the script using a text editor as per your preference. The first few lines of the script are related to the configuration, and you can change these as per your liking. The ‘OE_USER’ variable is used to store the user to be created under which Odoo will run. Another important configuration is ‘OE_PORT’, which mentions the http_port used by Odoo. If you need to configure Nginx also, you can use the other variables, which are pretty much self-explanatory.
Once you are satisfied with the values in the first few lines, you can save the script. Once saved, you can run the script as a superuser or root user since it requires elevated permission to install required packages and dependencies. Before running the script, make it executable using the following command.
chmod +x odoo_install.sh
Once the script is made executable, run it using the below command.
Once the script finishes running, you can check the OE_PORT with the IP address of the machine to access Odoo. As you can see, this is pretty easy, and any beginner can follow the same. If you face any issues with the script, you can either contact us or raise issues in the respective GitHub repositories.