Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
No Result
View All Result
Home Linux

Install Odoo 15 using Docker, Nginx on Ubuntu 22.04

by Cloudbooklet
1 year ago
in Linux
Install Odoo 15 Using Docker, Nginx On Ubuntu 22.04
ShareTweetSendShare
Readers like you help support Cloudbooklet. When you make a purchase using links on our site, we may earn an affiliate commission.

Install Odoo 15 using Docker Compose, Nginx, SSL on Ubuntu 22.04 . In this tutorial you are going to learn how to install and setup Odoo using Docker and Docker Compose and configure Nginx and Let’s Encrypt SSL and also install PostgreSQL. Installing Odoo using Docker Compose is the easiest way compared to install manually. […]

ADVERTISEMENT

Install Odoo 15 using Docker Compose, Nginx, SSL on Ubuntu 22.04 . In this tutorial you are going to learn how to install and setup Odoo using Docker and Docker Compose and configure Nginx and Let’s Encrypt SSL and also install PostgreSQL. Installing Odoo using Docker Compose is the easiest way compared to install manually.

Odoo is a management self hosted software to run a business with a top notch user experience. The applications within Odoo are perfectly integrated with each other, allowing you to fully automate your business processes easily.

Prerequisites

  1. Install Docker on Ubuntu 22.04
  2. Install Docker Compose on Ubuntu 22.04.

Please make sure you have completed all the above mentioned steps

ADVERTISEMENT
  • Domain pointed to your server IP address
  • Docker installed and configured
  • Docker Compose installed and configured

Step 1: Create a project directory

SSH to your server and start by creating a new project directory named odoo-project. You can also name it whatever you need.

mkdir odoo-project

Step 2: Create Docker Compose YAML file

Now navigate inside the project directory and create a new docker-compose.yml file with the following configuration.

cd odoo-project
nano docker-compose.yml

Paste the following configuration.

ADVERTISEMENT

You might also like

&Quot; Systemd Service On Linux

How to Create a New systemd Service on Linux: A Step-by-Step Guide

3 months ago
List Groups In Linux

How to List Groups in Linux: A Guide for Beginners

3 months ago
version: '3.9'
services:
    odoo:
        container_name: odoo
        image: odoo:15.0
        volumes:
            - ./addons-extra:/mnt/extra-addons
            - ./etc/odoo:/etc/odoo
            - odoo-web-data:/var/lib/odoo
        ports:
            - "8069:8069"
        depends_on:
            - postgres
    postgres:
        image: postgres:14
        environment:
            - POSTGRES_DB=postgres
            - POSTGRES_PASSWORD=odoo
            - POSTGRES_USER=odoo
            - PGDATA=/var/lib/postgresql/data/pgdata
        volumes:
            - odoo-db-data:/var/lib/postgresql/data/pgdata
    nginx:
        container_name: nginx
        image: nginx:latest
        restart: unless-stopped
        ports:
            - 80:80
            - 443:443
        volumes:
            - ./nginx/conf:/etc/nginx/conf.d
            - ./certbot/conf:/etc/nginx/ssl
            - ./certbot/data:/var/www/html
    certbot:
        container_name: certbot
        image: certbot/certbot:latest
        command: certonly --webroot --webroot-path=/var/www/html -- email [email protected] --agree-tos --no-eff-email -d domain.com -d www.domain.com
        volumes:
            - ./certbot/conf:/etc/letsencrypt
            - ./certbot/logs:/var/log/letsencrypt
            - ./certbot/data:/var/www/html
volumes:
    odoo-web-data:
    odoo-db-data:

Hit CTRL + X followed by Y and Enter to save the file and exit.

Here are the configuration details.

ADVERTISEMENT
  • version: Compose file version which is compatible with the Docker Engine. You can check compatibility here.
  • services: here we have 4 services named odoo, postgres, nginx and certbot.
  • image: We use latest Odoo 15, Postgres 14, Nginx and Certbot images available in Docker hub.
  • volumes:
    • nginx/conf: here we will place the Nginx configuration file to be synced with the default Nginx conf.d folder inside the container.
    • etc/odoo: here we will place the Odoo 15 database configuration.
    • cedtbot/conf: this is where we will receive the SSL certificate and this will be synced with the folder we wish to inside the container.
    • ports: configure the container to listen upon the listed ports.
    • command: the command used to receive the SSL certificate.

Step 3: Create Odoo Configuration

Now you can use custom Odoo configuration inside the directory as mentioned in the yml file in the Oddo service.

mkdir -p etc/odoo

Create a new file named odoo.conf

ADVERTISEMENT
nano etc/odoo/odoo.conf

Replace the highlighted values corresponding to your PostgreSQL values.

[options]
; This is the password that allows database operations:
; admin_passwd = admin
db_host = postgres
db_user = odoo
db_password = odoo

Here we will use the hostname same as the PostgreSQL service name.

ADVERTISEMENT

Step 4: Configure Nginx

Now you can create he default configuration file inside the directory as mentioned in the yml file in the Nginx service.

mkdir -p nginx/conf

Create a new file named default.conf

nano nginx/conf/default.conf

Paste the following configuration and replace the appropriate values with your domain name.

server {
    listen [::]:80;
    listen 80;

    location ~ /.well-known/acme-challenge {
        allow all;
        root /var/www/html;
    }

    location / {
        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $host;
        proxy_pass http://odoo:8069;
    }

    location ~* /web/static/ {
        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $host;
        proxy_pass http://odoo:8069;
    }
}

Step 5: Deploy Odoo with Docker

Now you can make the deployment using the following command.

Start the containers using the following command, you will receive the SSL certificates once the containers are started.

docker-compose up -d

Once all containers are started you will see additional directories for SSL will be created alongside your docker-compose.yml file.

The directory certbot holds all the files related to your SSL certificates.

To view the containers you can execute the following command.

docker-compose ps

Step 6: Configure SSL for Odoo in Docker

As you have received the Let’s Encrypt SSL certificate you can configure HTTPS and setup redirection to HTTPS.

Edit the default.conf and make the following changes.

sudo nano nginx/conf/default.conf
server {
    listen [::]:80;
    listen 80;

    server_name domain.com;

    return 301 https://www.domain.com$request_uri;
}

server {
    listen [::]:443 ssl http2;
    listen 443 ssl http2;

    server_name domain.com;

    ssl_certificate /etc/nginx/ssl/live/domain.com/fullchain.pem;
    ssl_certificate_key /etc/nginx/ssl/live/domain.com/privkey.pem;

    return 301 https://www.domain.com$request_uri;
}
server {
    listen [::]:443 ssl http2;
    listen 443 ssl http2;

    server_name domain.com;

    ssl_certificate /etc/nginx/ssl/live/domain.com/fullchain.pem;
    ssl_certificate_key /etc/nginx/ssl/live/domain.com/privkey.pem;

    location ~ /.well-known/acme-challenge {
        allow all;
        root /var/www/html;
    }

    location / {
        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $host;
        proxy_pass http://odoo:8069;
    }

    location ~* /web/static/ {
        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $host;
        proxy_pass http://odoo:8069;
    }
}

Now restart the Nginx service to load the new configurations.

docker-compose restart nginx

Step 7: Setup Odoo

Now you can visit your domain name on your web browser. You will see the page similar to the one below. Here you can create the database and admin user for your Odoo.

Odoo Installation

Fill in all appropriate values and click create database. Now Odoo will be ready to use.

Odoo 15 With Docker And Nginx

Conclusion

Learn a complete walk through of the Odoo Sales Application with tips on using advanced configurations.

Now you have learned how to install Odoo 15 on your Ubuntu 22.04 with Docker Compose, Nginx and secure it with Let’s Encrypt.

Thanks for your time. If you face any problem or any feedback, please leave a comment below.

Tags: DockerNginxOdooUbuntu 22.04
Share8Tweet5SendShare
Cloudbooklet

Cloudbooklet

Comments 3

  1. Avatar Of Dexter Dexter says:
    2 weeks ago

    Hello, how are you? I have a question regarding the ssl certificates, it does not generate them for me. Please, can you tell me what are the steps to generate them? Thank you.

    Reply
  2. Avatar Of Diogo Cordovil Diogo Cordovil says:
    8 months ago

    In step 4 you mention: Paste the following configuration and replace the appropriate values with your domain name.

    What appropriate values are you refering to ??

    I’ve followed all the steps here, but still the server does not recognize my domain.

    if I write my ip with port 8069 I can run my app, but when I enter the domain in the broswer I get a DNS_PROBE_FINISHED_NXDOMAIN error..

    I have two A records configured: one from mydomain.com pointing to my IP. The other pointing from http://www.mydomain.com pointing to my IP as well.

    What am I doing wrong??

    Reply
  3. Avatar Of Khalid Khalid says:
    10 months ago

    Hello,
    Nginx/SSL certificates are not working and still only work on port 8069
    Am I missing something?
    My testing website webtronex.ca

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related Posts

Hostname In Linux

How to Modify the Hostname in Linux

3 months ago
Linux Systems

Linux systems Hacked with OpenSSH Malware

3 months ago
Install Iptables On Ubuntu

How to Install Iptables on Linux

3 months ago
Open Port In Linux

How to Open Port in Linux: Simple Step-by-Step Guide

3 months ago

Follow Us

Trending Articles

Block Youtube Ads

How to Block YouTube Ads on Android TV in 2023 (6 Easy Methods)

September 20, 2023

How to Create and Customize Stunning Contact Poster on iPhone

Microsoft Unveils New Disc-Less Xbox Series X with Lift-to-Wake Controller

Create a Professional Website with Wix AI Website Builder

How to Become an AI Trainer: Skills, Salary, and Career Opportunities

Top 7 Free Dating Sites for Men in 2023

Popular Articles

Slideshow Maker

Top 9 Slideshow Makers for Bloggers and Content Creators

September 5, 2023

Winston AI: How to Check AI Plagiarism for Better SEO

Top 5 AI Portrait Generators for Free and Paid Options

3 Ways to View Instagram Posts Without Account (2023 Guide)

Top 5 Free Linux Cloud Servers to Host Your Website

Amazon Prime Big Deal Days 2023: Best Deals

Subscribe Now

loader

Subscribe to our mailing list to receives daily updates!

Email Address*

Name

Cloudbooklet Logo

Welcome to our technology blog, where we explore the latest advancements in the field of artificial intelligence (AI) and how they are revolutionizing cloud computing. In this blog, we dive into the powerful capabilities of cloud platforms like Google Cloud Platform (GCP), Amazon Web Services (AWS), and Microsoft Azure, and how they are accelerating the adoption and deployment of AI solutions across various industries. Join us on this exciting journey as we explore the endless possibilities of AI and cloud computing.

  • About
  • Contact
  • Disclaimer
  • Privacy Policy

Cloudbooklet © 2023 All rights reserved.

No Result
View All Result
  • News
  • Artificial Intelligence
  • Applications
  • Linux

Cloudbooklet © 2023 All rights reserved.