Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install Odoo with Docker on Ubuntu

This guide shows you how to run Odoo inside Docker on an Ubuntu server. It needs root access, so it is for VPS and dedicated server users. Docker must already be installed.

VPS and Cloud Servers2 min read10 steps

What are Odoo and Docker?

Odoo is a business program. It has apps for sales, shop orders, accounting, stock and more.

Docker runs programs in containers. A container is like a lunch box that holds one program and all it needs. Odoo needs a database, so you will run two containers. One is the database (PostgreSQL). The other is Odoo.

Steps

  1. Log in to your server with SSH. SSH lets you type commands on a remote computer.
  2. Check that Docker works.
    docker --version
  3. Create a private network so the two containers can talk to each other.
    docker network create odoo-net
  4. Create a place to keep the database files, so they stay safe if a container is removed.
    docker volume create odoo-db-data
    docker volume create odoo-web-data
  5. Start the database container. Change choose-a-strong-password to your own password.
    docker run -d --name odoo-db --network odoo-net \
      -e POSTGRES_USER=odoo \
      -e POSTGRES_PASSWORD=choose-a-strong-password \
      -e POSTGRES_DB=postgres \
      -v odoo-db-data:/var/lib/postgresql/data \
      postgres:15
  6. Start the Odoo container. Use the same password.
    docker run -d --name odoo --network odoo-net -p 8069:8069 \
      -e HOST=odoo-db -e USER=odoo -e PASSWORD=choose-a-strong-password \
      -v odoo-web-data:/var/lib/odoo \
      odoo
    The -p 8069:8069 part opens port 8069. A port is like a numbered door into your server.
  7. Check that both containers run.
    docker ps
  8. If a firewall is on, allow the port. With UFW:
    ufw allow 8069/tcp
  9. Open a browser and go to http://YOUR-SERVER-IP:8069.
  10. Fill in the new database form. Give it a name, your email and a password. Then click Create database.

If something goes wrong

Look at the Odoo messages with this command. It shows the log, which is a diary of what the program did.

docker logs odoo
Tip: Back up your volumes before you update or remove containers. Removing a volume deletes your data for good.

Quick recap

  • Odoo needs two containers: PostgreSQL and Odoo.
  • Put them on one Docker network.
  • Use volumes to keep your data safe.
  • Open port 8069 in your browser to finish setup.