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.
| Item | Monthly 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.

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.
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 adddnsto your--serviceslist. - 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.
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
Here's the sequence, tool by tool:
-
Survey the options. It calls
list_regions,list_images(filtered to Ubuntu) andlist_vm_packagesto find a region near you, a current Ubuntu LTS image and a package for 2 vCPU and 4 GB. -
Sort out the SSH key. It calls
list_ssh_keysto see what's registered. If your key isn't there, it registers your existing public key (for example~/.ssh/id_ed25519.pub) withcreate_ssh_key. -
Price it first. It calls
get_cost_estimate_vmwith the exact region, package, disk size and image, and shows you the monthly number before creating anything. -
Create the server. On your go-ahead,
create_vmprovisions the VM. The same call carrieskeypairsto install your SSH key andnetworkAccess.inboundPortsto 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 pollsget_vmuntil the VM is running. -
Point the domain at it. It calls
list_dns_zonesto see whether your domain is already hosted. If not,create_dns_zoneadds it, and you set your registrar's nameservers tons1.americancloud.organdns2.americancloud.org. Thencreate_dns_recordadds the record:Hostname Type Value odooA the VM's public IP -
Install Docker. Now in the terminal, it installs Docker Engine and the Compose plugin over SSH.
-
Write the files. It writes
compose.yml, theCaddyfileandconfig/odoo.confin/opt/odoo. -
Write the secrets on the server. It generates three passwords with
openssl rand -hex 32on the VM and writes them into.envandodoo.conf. The values never pass through the chat. Then it creates theodoodatabase role, which can log in and create databases but isn't a superuser. -
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.
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:
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:
[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 = 1200proxy_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_passwdguards those screens. Odoo only reads it from the config file, and its default isadmin. The prompt set a 64-character random one.dbfilter = ^odoo$makes Odoo show only the database namedodoo.list_db = Falsehides the database list and blocks the manager screens entirely. Odoo's docs say to set it oncedbfiltermatches a single database. You needed the manager once, to create that database. Now close it.
Paste this after you've created the database:
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:
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.gzIt sends both off the server to S3-compatible object storage. Paste this once the site is up:
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.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:
cd /opt/odoo && docker compose pull odoo && docker compose up -d odooMajor 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
- Deploy with AI overview: what else your assistant can build on American Cloud
- Deploy a Docker Compose app: the general pattern for running any compose stack on a VM
- Backups and restore: snapshots, nightly dumps and the restore drill
- Object storage: an off-server home for your database dumps and filestore archives
- Pricing: every rate behind the numbers on this page