Today, we’ll talk how you can deploy Odoo 13 on Ubuntu 18.04 (Bionic Beaver) Linux machine. Odoo is the most depended on suite of Internet based totally Open Source commercial enterprise programs that permit you to drive the business in the proper route. Odoo gives you get right of entry to to crucial enterprise packages, all managed from a single console. So, in this tutorial you will learn how to Install Odoo on Ubuntu 18.04.
Various commercial enterprise programs to be had on Odoo consists of Open Source CRM, website builder, eCommerce, warehouse management, project management, billing & accounting, point of sale, human resources, marketing, manufacturing, buy control, among others.
An amazing point to note is that Odoo apps can be used as stand-alone applications, however in addition they combine seamlessly so you get a complete-featured Open Source ERP while you deploy numerous apps.
Step 1: Update Your System
As usual, update & upgrade your system & then reboot it to finish upgrading.
sudo apt update
sudo apt -y upgrade
sudo reboot
Step 2: Database
Make sure you’ve installed Database. I would recommend you to Install PostgreSQL if you haven’t installed it so far.
How To Install PostgreSQL 12 on Ubuntu 18.04
Step 3: Install wkhtmltopdf
Please follow the below guide on how to Install wkhtmltopdf as it is not present in Ubuntu repositories.
Step 4: Installing Odoo 13 on Ubuntu 18.04
Now, add Odoo repository to start Installing Odoo.
wget -O - https://nightly.odoo.com/odoo.key | sudo apt-key add -
echo "deb http://nightly.odoo.com/13.0/nightly/deb/ ./" | sudo tee /etc/apt/sources.list.d/odoo.list
Make an update & hit install Odoo command. Then press Y when prompted.
sudo apt udpate
sudo apt install odoo
Check the status as it will auto start as soon as Installation of Odoo get completed.
systemctl status odoo
Then set it up to start every time when you do a boot.
sudo systemctl enable --now odoo
As the Odoo service uses port 8069, so let it confirm by
ss -tunelp | grep 8069
Step 5: Configure Nginx Proxy to Install Odoo
Fire the below command to Install nginx
sudo apt -y install nginx
Here we will consider the two scenarios for Nginx Proxy Configuration. One of them is HTTPS & when traffic is not served over secure connection. We will here consider the both steps.
Setting Up HTTP Proxy For Odoo
Set up new configuration file for Odoo & paste the data. Then set it according to your own requirements like changing server name.
sabi@Ubuntu:~$ sudo nano /etc/nginx/conf.d/odoo.conf
Odoo Upstreams
upstream odooserver {
server 127.0.0.1:8069;
}
server {
listen 80;
server_name erp.osradar.com;
access_log /var/log/nginx/odoo_access.log;
error_log /var/log/nginx/odoo_error.log;
# Proxy settings proxy_read_timeout 720s; proxy_connect_timeout 720s; proxy_send_timeout 720s; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; # Request for root domain location / { proxy_redirect off; proxy_pass http://odooserver; } # Cache static files location ~* /web/static/ { proxy_cache_valid 200 90m; proxy_buffering on; expires 864000; proxy_pass http://odooserver; } # Gzip gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript; gzip on;
}
Don’t forget to change erp.osradar.com with yours. Keep in mind that a valid DNS record is required for external access.
See the config syntax:
sabi@Ubuntu:~$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Make sure settings are ok, then restart nginx services.
sudo systemctl restart nginx
Check that no error found. If you encountered an issue, then try the below command if you’ve installed Apache server.
sudo killall apache2
Now, restart Nginx services and check status it should be running fine.
Using Up Let’s Encrypt SSL Certificate For Odoo on Nginx
For security reasons, make sure to Encrypt Odoo on Nginx. You can choose any purchased SSL but here I’m using Free SSL Let’s Encrypt.
Follow the below procedure to get SSL certificate for your domain.
wget https://dl.eff.org/certbot-auto
chmod +x certbot-auto
sudo mv certbot-auto /usr/local/bin/certbot-auto
sudo systemctl stop nginx
export DOMAIN="erp.osradar.com"
export EMAIL="[email protected]"
sudo /usr/local/bin/certbot-auto certonly --standalone -d ${DOMAIN} --preferred-challenges http --agree-tos -n -m ${EMAIL} --keep-until-expiring
Note: Replace osradar.com with your domain.
When the execution success, paths to the certificate & chain files will be printed out.
IMPORTANT NOTES:
Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/erp.osradar.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/erp.osradar.com/privkey.pem
Your cert will expire on 2020-01-17. To obtain a new or tweaked
version of this certificate in the future, simply run certbot-auto
again. To non-interactively renew all of your certificates, run
"certbot-auto renew"
Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.
If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
To renew certificate , create a cron
sudo crontab -e
15 3 * * * /usr/local/bin/certbot-auto renew --pre-hook "systemctl stop nginx" --post-hook "systemctl start nginx"
Then create a new configuration file of odoo
sudo vim /etc/nginx/conf.d/odoo.conf
Modify & paste the below data into the file and save it.
Odoo Upstreams
upstream odooserver {
server 127.0.0.1:8069;
}
http to https redirection
server {
listen 80;
server_name erp.osradar.com;
return 301 https://erp.osradar.com$request_uri;
}
server {
listen 443 ssl;
server_name erp.osradar.com;
access_log /var/log/nginx/odoo_access.log;
error_log /var/log/nginx/odoo_error.log;
# SSL
ssl_certificate /etc/letsencrypt/live/erp.osradar.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/erp.osradar.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/erp.osradar.com/chain.pem;
# Proxy settings proxy_read_timeout 720s; proxy_connect_timeout 720s; proxy_send_timeout 720s; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; # Request for root domain location / { proxy_redirect off; proxy_pass http://odooserver; } # Cache static files location ~* /web/static/ { proxy_cache_valid 200 90m; proxy_buffering on; expires 864000; proxy_pass http://odooserver; } # Gzip Compression gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript; gzip on;
}
Now, restart nginx services to take effects.
sudo systemctl restart nginx
Step 6: Access Odoo Web Interface
You can access Odoo by typing your domain name in web browser or at localhost:8069/. You will be prompted to create a database first.
Then you will be redirected to Odoo dashboard after creating database.
Here you can perform all the tasks you want and you can use Odoo Apps. So, this is how you can Install Odoo & from Odoo dashboard Install oddo apps.