Self-host Odoo

Last updated:

Odoo Online charges per user. Its Standard plan is $24.90 per user per month billed yearly, so a 10-person team pays $249 a month. Self-hosted Odoo Community charges per server: the VM in this recipe costs $43.125 a month on American Cloud, whether 2 people log in or 20.

Your own server is the third way to host Odoo, after Odoo Online and Odoo.sh. With the American Cloud MCP server connected, one prompt has your AI assistant price the VM before anything is billed, create it, and install Odoo Community 20 with Docker Compose, Caddy for HTTPS and PostgreSQL 17. The same prompt gets right what copied guides get wrong: a PostgreSQL version Odoo 20 accepts, the websocket route, a database user that isn't a superuser and a master password that isn't admin. Two short follow-up prompts close the database manager and set up nightly backups that include the filestore.

What it costs

Odoo Community is free software under the LGPLv3, with no user cap, so self-hosting it costs what the server costs.

ItemMonthly cost
VM: 2 vCPU, 4 GB RAM, 50 GB disk (monthly term)$43.125
Public IP (the network's own address)$0
Network created with the VM$0
Egress (page views, attachments, API traffic)$0
Object storage for nightly backups, optional$5 (250 GB minimum)
Snapshot before an upgrade, optional$10 per 100 GB

Billed by the hour instead, the VM costs 2% more.

American Cloud's price calculator set to Standard, 2 vCPU, 4 GB of memory, 50 GB of storage and a monthly billing cycle, showing an estimated $43.13 a month

On Odoo Online, Standard billed monthly is $31.10 a user. Both Standard prices are first-year discounts for the users you start with, and the regular prices are $31.10 billed yearly and $38.90 billed monthly. One App Free is $0 for a single app with unlimited users, on Odoo Online only.

[ Monthly cost by team size ]
Monthly cost of a self-hosted Odoo server against Odoo Online Standard by team sizeAmerican Cloud, one 2 vCPU, 4 GB, 50 GB server at any team size: $43.125 a month. Odoo Online Standard billed yearly at $24.90 per user: 1 user $24.90, 2 users $49.80, 5 users $124.50, 10 users $249, 20 users $498.Your own server, any team sizeAmerican Cloud$43.125Odoo Online Standard, billed yearly1 user$24.902 users$49.805 users$124.5010 users$24920 users$498
Odoo Online Standard at $24.90 a user a month billed yearly, a first-year price, from odoo.com/pricing, read December 2026. The American Cloud server is the same price at any team size.

From two users on, the server costs less, and every person you add widens the gap.

Odoo Online runs Odoo Enterprise, and this recipe runs Community. Community covers CRM, Sales, Point of Sale, Invoicing with payments, Expenses, Inventory, Manufacturing, Website Builder, eCommerce, Live Chat and eLearning. It doesn't have full accounting (general ledger and bank reconciliation), Payroll, Documents, Spreadsheet, Sign, Subscriptions, Rental, Barcode, Studio or the Android and iOS apps, and it comes without Odoo's functional support. Running Enterprise on your own server needs the Custom plan, at $49 per user per month billed yearly (also a first-year price), on top of the server.

Self-host when several people need several Community apps, and you'd rather pay for a server than for seats. Your data sits in your own PostgreSQL on a SOC 2 Type II audited cloud, and nothing about the setup ties you to us.

How big a server

Odoo publishes no minimum spec. Its deploy docs give a formula instead: workers = (CPU × 2) + 1, and "1 worker ~= 6 concurrent users". For memory, it assumes 20% of requests are heavy, at about 1 GB of RAM each, and 80% are light, at about 150 MB.

Here's our math for 2 vCPU:

  • (2 × 2) + 1 = 5 workers. Odoo's own example counts the cron worker inside that total, so that's 4 workers for web requests and 1 for scheduled jobs.
  • 4 workers × 6 = about 24 people clicking at the same moment. A team with more named users fits, since they don't all click at once.
  • 5 × (0.8 × 150 MB + 0.2 × 1,024 MB) = 1,624 MB, about 1.6 GB for Odoo.

That leaves about 2.4 GB of the 4 GB for PostgreSQL, Caddy and Ubuntu. Forum answers on odoo.com and a freeCodeCamp tutorial land on the same 2 vCPU and 4 GB. A 2 GB server fits 2 workers at most. When the team outgrows 4 GB, your assistant resizes the VM in place with scale_vm. On 4 vCPU the formula gives 9 workers.

Why Claude Code for this

Any MCP client can create the server. Installing Odoo also means running commands on it: SSH in, install Docker, write the compose file and odoo.conf, create the database user. Claude Code has the American Cloud tools and your terminal in one session, so it can do both without you switching tools. That's the setup this recipe assumes. Cursor and the other clients work too. With those, you run the SSH steps yourself when the assistant tells you to.

Provisioning is a write operation. You'll need write access: set the app to Full access in Connected apps on the hosted server, or use a Full access API token and the --allow-writes flag on the local server. See the overview for setup and safety details. To explore first, set the app to Read-only, then switch to write access when you're ready to build.

Before you start

  • A domain you control. Caddy can't get a certificate until an A record points a subdomain, such as odoo, at the server.
  • The MCP server connected to your assistant with write access, as the note above describes. On the local server, the DNS tools are off by default: start it with --services all, or add dns to your --services list.
  • Your existing SSH key pair. The assistant registers the public key. The private key never leaves your machine.
  • An SMTP relay account from your email provider, for invoices, quotes and password resets. You can add it after the install.

The one prompt that does it

Open Claude Code and paste this, filling in the placeholders. Read the cost estimate before you approve anything.

text
I want to self-host Odoo Community 20 on American Cloud at
odoo.{your-domain.com}, with Docker Compose, Caddy for HTTPS and PostgreSQL.
Plan it out first, then walk through it step by step:
 
1. List the available regions, Ubuntu images and VM packages. Size the VM at
   2 vCPU, 4 GB of RAM and a 50 GB disk.
2. Check whether my SSH key is already registered. If not, register my
   existing public key ~/.ssh/id_ed25519.pub with create_ssh_key. Never
   create a key pair for me. If I have none, ask me before you run ssh-keygen.
3. Show me the monthly cost estimate for the VM before creating anything.
   Wait for me to confirm.
4. Create an Ubuntu VM with that SSH key and open inbound ports 22, 80 and
   443 only. Wait until it's running and has a public IP.
5. DNS: check whether {your-domain.com} is already a zone on American Cloud.
   If not, create the zone and tell me to set my registrar's nameservers to
   ns1.americancloud.org and ns2.americancloud.org. Then add an A record
   with Hostname odoo, Type A, Value the VM's public IP.
6. Over SSH, install Docker Engine and the Docker Compose plugin.
7. In /opt/odoo, write compose.yml with three services on one Docker
   network: odoo (image odoo:20.0), db (image postgres:17) and caddy
   (image caddy:2). Only caddy publishes ports, 80 and 443. Give odoo a
   named volume at /var/lib/odoo and db a named volume for its data.
8. Write a Caddyfile for odoo.{your-domain.com} that sends paths starting
   with /websocket to odoo:8072 and everything else to odoo:8069, over the
   Docker network, not 127.0.0.1.
9. Generate the Postgres superuser password, a password for a database role
   called odoo, and Odoo's admin_passwd on the server with
   openssl rand -hex 32. Never print their values in this chat. Create the
   odoo role with LOGIN and CREATEDB, and make sure it is not a superuser.
10. Write /opt/odoo/config/odoo.conf with db_host = db, db_user = odoo,
    proxy_mode = True, workers = 4, gevent_port = 8072, Odoo's sample
    memory and time limits from its deploy docs, data_dir = /var/lib/odoo,
    dbfilter = ^odoo$ and the admin_passwd. Make it readable by the odoo
    user inside the container and no one else.
11. Once odoo.{your-domain.com} resolves to the VM, run docker compose up -d
    in /opt/odoo. Check the caddy and odoo logs for a certificate and a
    clean start.
 
Then give me the URL, and one SSH command that prints admin_passwd so I can
save it in my password manager.

What your assistant will do

[ How a request reaches Odoo ]
The path a request takes from the browser to Odoo and PostgreSQLA browser connects over HTTPS on port 443 to Caddy, the only container that publishes ports, 80 and 443. Over the Docker network, Caddy sends paths starting with /websocket to Odoo's websocket worker on port 8072 and every other path to Odoo's HTTP workers on port 8069. Both run in one odoo container, which keeps attachments in the filestore on the odoo-data volume and its data in PostgreSQL 17. PostgreSQL publishes no port and keeps its files on the pg-data volume.BrowserHTTPS :443Your VMCaddyports 80, 443other paths/websocket*Odoo HTTPodoo:8069Odoo websocketodoo:8072odoo containerfilestoreodoo-data volumePostgreSQL 17not publisheddatabasepg-data volumeOne Docker network. Only Caddy publishes ports.
Caddy is the only way in. It reaches both Odoo ports by name over the Docker network, and both volumes sit on the VM's disk.

Here's the sequence, tool by tool:

  1. Survey the options. It calls list_regions, list_images (filtered to Ubuntu) and list_vm_packages to find a region near you, a current Ubuntu LTS image and a package for 2 vCPU and 4 GB.

  2. Sort out the SSH key. It calls list_ssh_keys to see what's registered. If your key isn't there, it registers your existing public key (for example ~/.ssh/id_ed25519.pub) with create_ssh_key.

  3. Price it first. It calls get_cost_estimate_vm with the exact region, package, disk size and image, and shows you the monthly number before creating anything.

  4. Create the server. On your go-ahead, create_vm provisions the VM. The same call carries keypairs to install your SSH key and networkAccess.inboundPorts to open 22, 80 and 443 on the network's own public IP. Opening a port this way sets up the firewall rule and the port forwarding together. The assistant polls get_vm until the VM is running.

  5. Point the domain at it. It calls list_dns_zones to see whether your domain is already hosted. If not, create_dns_zone adds it, and you set your registrar's nameservers to ns1.americancloud.org and ns2.americancloud.org. Then create_dns_record adds the record:

    HostnameTypeValue
    odooAthe VM's public IP
  6. Install Docker. Now in the terminal, it installs Docker Engine and the Compose plugin over SSH.

  7. Write the files. It writes compose.yml, the Caddyfile and config/odoo.conf in /opt/odoo.

  8. Write the secrets on the server. It generates three passwords with openssl rand -hex 32 on the VM and writes them into .env and odoo.conf. The values never pass through the chat. Then it creates the odoo database role, which can log in and create databases but isn't a superuser.

  9. Bring it up. Once the name resolves, it runs docker compose up -d. Caddy gets a certificate, redirects port 80 to HTTPS, and passes traffic to Odoo over the Docker network.

When it's done, the assistant hands you https://odoo.{your-domain.com}. Odoo opens its create-database screen. Enter the master password (the admin_passwd that the SSH command prints), name the database odoo (the only name dbfilter matches), and leave demo data off. Then lock it down.

Tell the assistant to explain each step before it runs it if you want to follow along: "narrate what you're about to do and why." Destructive operations are flagged regardless, and clients that support confirmations will prompt you before anything irreversible.

The files on the server

The compose file pins odoo:20.0, the current major, not latest, so an update can't jump you to Odoo 21. It runs postgres:17 because Odoo 20 needs PostgreSQL 16 or newer. Docker Hub's Odoo page still shows postgres:15 in its example, below that minimum, and so do some tutorials.

yaml
services:
  odoo:
    image: odoo:20.0
    depends_on:
      - db
    volumes:
      - ./config:/etc/odoo
      - odoo-data:/var/lib/odoo
    restart: unless-stopped
 
  db:
    image: postgres:17
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    volumes:
      - pg-data:/var/lib/postgresql/data
    restart: unless-stopped
 
  caddy:
    image: caddy:2
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - caddy-data:/data
      - caddy-config:/config
    restart: unless-stopped
 
volumes:
  odoo-data:
  pg-data:
  caddy-data:
  caddy-config:

Neither odoo nor db has a ports: line, so nothing outside the VM can reach 8069, 8072 or PostgreSQL, even if a firewall rule opens one of those ports by mistake later. Caddy reaches them by service name over the Docker network. The odoo-data volume holds the filestore, where Odoo keeps every attachment, and it must match data_dir in odoo.conf.

The Caddyfile routes the websocket separately:

text
odoo.{your-domain.com} {
	handle /websocket* {
		reverse_proxy odoo:8072
	}
	handle {
		reverse_proxy odoo:8069
	}
}

With workers set, Odoo runs a separate worker for live chat and notifications on gevent_port, 8072 by default, and the proxy has to send /websocket traffic there. Caddy's reverse_proxy carries WebSocket connections with no extra settings. Older guides call this option longpolling_port. Odoo 20 calls it gevent_port.

The essentials of config/odoo.conf:

ini
[options]
db_host = db
db_user = odoo
db_password = <generated on the server>
admin_passwd = <generated on the server>
dbfilter = ^odoo$
data_dir = /var/lib/odoo
proxy_mode = True
workers = 4
gevent_port = 8072
; Odoo's sample limits from its deploy docs, written for a 4 CPU server
limit_memory_hard = 1677721600
limit_memory_soft = 629145600
limit_request = 8192
limit_time_cpu = 600
limit_time_real = 1200

proxy_mode = True belongs only behind a reverse proxy, which Caddy is.

Lock it down after the first database

Three settings protect the database manager, the screens that create, copy, drop and restore whole databases. Odoo's deploy docs are blunt about it: "It is strongly recommended to disable the Database Manager for any internet-facing system!" They call it "a development/demo tool" that "may even expose dangerous features to attackers."

  • admin_passwd guards those screens. Odoo only reads it from the config file, and its default is admin. The prompt set a 64-character random one.
  • dbfilter = ^odoo$ makes Odoo show only the database named odoo.
  • list_db = False hides the database list and blocks the manager screens entirely. Odoo's docs say to set it once dbfilter matches a single database. You needed the manager once, to create that database. Now close it.

Paste this after you've created the database:

text
On my Odoo VM, add list_db = False to /opt/odoo/config/odoo.conf and
restart the odoo container. Then confirm that
https://odoo.{your-domain.com}/web/database/manager no longer opens, and
that docker compose ps shows no published ports except Caddy's 80 and 443.

Odoo's docs set one more rule, for the database user: "Make sure the PostgreSQL user (--db_user) is not a super-user." The Docker Hub example sets POSTGRES_USER=odoo, and the postgres image makes that user a superuser, so as we read it, the example breaks Odoo's own advice. This recipe keeps postgres as the superuser for maintenance and gives Odoo a separate odoo role without superuser rights.

Outgoing email

Odoo sends quotes, invoices, invites and password resets by email, and it needs an SMTP relay to do it. Use the one from your email provider. American Cloud doesn't block outgoing mail, so the VM can reach the relay on port 25, 465 or 587 from the start. In Odoo's Settings, add the relay as an outgoing mail server with its host, port, username and password. Type the password into Odoo's form yourself, not into the chat. Test the connection from that form, then invite a second user and check that the invite arrives.

Backups and updates

Odoo's deploy docs ask for "daily backups of your databases and filestore data." You need both. Attachments, including uploaded files and product images, live in the filestore under /var/lib/odoo, not in the database. A database dump alone restores records that point at files you no longer have.

The nightly job dumps the database in PostgreSQL's custom format and archives the filestore:

bash
docker compose exec -T db pg_dump -U postgres -F c odoo > odoo-$(date +%F).dump
docker compose exec -T odoo tar -czf - -C /var/lib/odoo filestore/odoo > filestore-$(date +%F).tar.gz

It sends both off the server to S3-compatible object storage. Paste this once the site is up:

text
Set up nightly backups for Odoo in /opt/odoo. Create an object storage
unit and a bucket called odoo-backups, and show me the cost first. On the
VM, write a script that runs pg_dump -F c on the odoo database from the db
container, archives /var/lib/odoo/filestore/odoo from the odoo container,
and uploads both to the bucket with the date in the name. Store the
bucket's keys on the server only. Run it once and show me the two files.
Then restore both into a scratch database and a scratch folder on the VM
to prove they work, delete the scratch copies, and schedule the script
with cron for 3 a.m. every day, keeping the last 14 days.
[ The odoo-backups bucket ]
The odoo-backups bucket after three nightsA bucket listing with two files per night: odoo-DATE.dump, the database dump, and filestore-DATE.tar.gz, the filestore archive, for December 1, 2 and 3. Files older than 14 days are deleted.odoo-backups6 objectsNameWhat it isodoo-2026-12-03.dumpdatabase dumpfilestore-2026-12-03.tar.gzfilestore archiveodoo-2026-12-02.dumpdatabase dumpfilestore-2026-12-02.tar.gzfilestore archiveodoo-2026-12-01.dumpdatabase dumpfilestore-2026-12-01.tar.gzfilestore archiveNightly at 3 a.m. Older than 14 days: deleted.
Two files a night, and a restore needs both: the dump brings back the records, the archive brings back the attachments they point to.

A backup you've never restored is a guess. Backups and restore covers the full restore drill, onto a fresh VM.

Updates inside Odoo 20. Odoo republishes the 20.0 image with fixes. To take them:

bash
cd /opt/odoo && docker compose pull odoo && docker compose up -d odoo

Major versions. The Odoo Community Association (OCA) says it plainly: "Community Edition (CE) does not support migrations from one major release to another." Odoo's upgrade service upgrades Enterprise databases for free, and its upload form asks for an Enterprise subscription code. For Community, OCA's OpenUpgrade is the path, one major version per hop: 20 to 21, then 21 to 22. Take a snapshot of the VM and a fresh backup before each hop, so a failed migration is a revert, not a rebuild. There's no rush: Odoo supports each major version for three years.

Troubleshooting

Live chat and notifications only update when you reload the page. The websocket isn't getting through. Check that the Caddyfile sends /websocket* to odoo:8072 and that odoo.conf has proxy_mode = True. If you later set workers = 0, Odoo serves the websocket on 8069 instead, and the 8072 route goes nowhere.

The browser shows a certificate error. Caddy can't get a certificate until odoo.{your-domain.com} resolves to the VM and port 80 is reachable from the internet. Ask your assistant to "check what odoo.{your-domain.com} resolves to, confirm 80 and 443 are open with list_firewall_rules, and show me the caddy logs."

You see "The database manager has been disabled by the administrator". That's the lock-down working. Backups and restores go through pg_dump and the script above, not through that screen.

PDF reports fail or come out blank. wkhtmltopdf is already in the image, so don't install another copy on the VM. Tell your assistant: "show me the odoo container logs from the moment I print a report."

Odoo restarts or requests fail under load. The VM is likely short on memory. Have your assistant price 8 GB of RAM, then resize with scale_vm, and raise workers only if you add vCPU too.

Stuck on the American Cloud side, like the VM, the network or DNS? Support replies in under 2 minutes.

Next steps

Contact us