Odoo How to Install on Amazon EC2: Exact Ubuntu Commands
If you want to install Odoo on Amazon AWS, EC2 + Ubuntu 24.04 LTS is a practical setup for a self-hosted Odoo environment. The examples below use the standard AWS Ubuntu user, ubuntu, and Odoo 19.
Important: Run the following commands from an SSH session connected to your EC2 server. The
$represents the terminal prompt and should not be copied.
1. Launch an Ubuntu EC2 Instance
Create an EC2 instance in your preferred AWS region and select Ubuntu Server 24.04 LTS.
For SSH access, use the Ubuntu user:
ubuntu@your-server-ip:~$
Connect from your local computer:
ssh -i "your-key.pem" ubuntu@YOUR_EC2_PUBLIC_IP
Example:
ssh -i "odoo-aws.pem" ubuntu@3.123.45.67
The first time you connect, Ubuntu may ask you to confirm the host:
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Enter:
yes
You should then see:
ubuntu@ip-172-31-xx-xx:~$
Do not use root as your normal Odoo administration user. The AWS Ubuntu image is designed to use the ubuntu account with sudo privileges.
2. Update Ubuntu
Run:
sudo apt update
sudo apt upgrade -y
Install common dependencies:
sudo apt install -y git wget curl unzip build-essential python3 python3-pip python3-venv python3-dev \
libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libjpeg-dev libpq-dev \
libffi-dev libssl-dev libtiff5-dev libopenjp2-7-dev liblcms2-dev \
libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev
Check your Ubuntu version:
lsb_release -a
Check Python:
python3 --version
3. Install PostgreSQL
Odoo uses PostgreSQL as its database server.
Install PostgreSQL:
sudo apt install -y postgresql postgresql-client
Check PostgreSQL:
sudo systemctl status postgresql
If it is not running:
sudo systemctl enable --now postgresql
Create the PostgreSQL user for Odoo:
sudo -u postgres createuser -s odoo
Verify the user:
sudo -u postgres psql -c "\du"
You should see an Odoo database user in the output.
4. Create the Odoo System User
Create a dedicated Linux user for Odoo:
sudo adduser --system --home=/opt/odoo --group odoo
Create the required directories:
sudo mkdir -p /opt/odoo
sudo mkdir -p /var/log/odoo
sudo mkdir -p /etc/odoo
Set ownership:
sudo chown -R odoo:odoo /opt/odoo
sudo chown -R odoo:odoo /var/log/odoo
sudo chown -R odoo:odoo /etc/odoo
5. Download Odoo 19 from GitHub
Switch to the Odoo user:
sudo -u odoo -H bash
You should now see something similar to:
odoo@ip-172-31-xx-xx:~$
Clone the Odoo 19 source code:
git clone --depth 1 --branch 19.0 https://github.com/odoo/odoo.git /opt/odoo/odoo
Verify:
ls /opt/odoo/odoo
Exit back to the Ubuntu user:
exit
You should again see:
ubuntu@ip-172-31-xx-xx:~$
6. Create the Python Virtual Environment
Create the environment:
sudo -u odoo python3 -m venv /opt/odoo/venv
Install Python dependencies:
sudo -u odoo /opt/odoo/venv/bin/pip install --upgrade pip setuptools wheel
Install Odoo requirements:
sudo -u odoo /opt/odoo/venv/bin/pip install -r /opt/odoo/odoo/requirements.txt
Depending on the Ubuntu image and Python packages available, some dependencies may require additional system libraries.
7. Create the Odoo Configuration File
Create the configuration file:
sudo nano /etc/odoo/odoo.conf
Add:
[options]
admin_passwd = CHANGE_THIS_TO_A_STRONG_MASTER_PASSWORD
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/odoo/addons
logfile = /var/log/odoo/odoo.log
proxy_mode = True
Save with:
CTRL + O
ENTER
CTRL + X
Secure the file:
sudo chown odoo:odoo /etc/odoo/odoo.conf
sudo chmod 640 /etc/odoo/odoo.conf
8. Test Odoo Manually
Run:
sudo -u odoo /opt/odoo/venv/bin/python /opt/odoo/odoo/odoo-bin \
-c /etc/odoo/odoo.conf
If Odoo starts successfully, you should see log output indicating that Odoo is running.
Open:
http://YOUR_EC2_PUBLIC_IP:8069
For example:
http://3.123.45.67:8069
AWS Security Group
Your EC2 Security Group must allow TCP port 8069 for this temporary test.
For production, do not leave Odoo port 8069 publicly exposed. Use Nginx and HTTPS instead.
9. Create an Odoo Systemd Service
Stop the test server with:
CTRL + C
Create the service:
sudo nano /etc/systemd/system/odoo.service
Add:
[Unit]
Description=Odoo 19
After=network.target postgresql.service
[Service]
Type=simple
User=odoo
Group=odoo
ExecStart=/opt/odoo/venv/bin/python /opt/odoo/odoo/odoo-bin -c /etc/odoo/odoo.conf
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
Save and exit.
Reload systemd:
sudo systemctl daemon-reload
Enable Odoo at boot:
sudo systemctl enable odoo
Start Odoo:
sudo systemctl start odoo
Check status:
sudo systemctl status odoo
If everything is working, you should see:
Active: active (running)
View live Odoo logs:
sudo journalctl -u odoo -f
Or:
sudo tail -f /var/log/odoo/odoo.log
10. Install Nginx
Install Nginx:
sudo apt install -y nginx
Create a website configuration:
sudo nano /etc/nginx/sites-available/odoo
Example:
server {
listen 80;
server_name odoo.example.com;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
location / {
proxy_pass http://127.0.0.1:8069;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Enable it:
sudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/odoo
Test Nginx:
sudo nginx -t
Restart:
sudo systemctl restart nginx
11. Secure Odoo With HTTPS
Install Certbot:
sudo apt install -y certbot python3-certbot-nginx
Request an SSL certificate:
sudo certbot --nginx -d odoo.example.com
Test automatic renewal:
sudo certbot renew --dry-run
Your Odoo installation should now be accessible through:
https://odoo.example.com
12. AWS Firewall Configuration
A production EC2 Security Group should generally allow:
22 SSH
80 HTTP
443 HTTPS
Do not expose:
8069
5432
to the entire internet unless there is a specific architectural requirement.
Restrict SSH access to trusted IP addresses wherever possible.
13. Don't Forget Odoo Backups
A production Odoo server contains both the PostgreSQL database and the Odoo filestore. Back up both.
A basic PostgreSQL backup command is:
sudo -u postgres pg_dumpall > /home/ubuntu/odoo-postgresql-backup.sql
For a real production environment, implement automated encrypted backups, off-server storage, retention policies and periodic restore testing rather than relying on a manual command.
Should You Install Odoo on Amazon Yourself?
The commands above will get a technical team to a working Odoo 19 environment on AWS. But production deployment is more than installation — database performance, worker tuning, PostgreSQL configuration, Nginx, SSL, backups, monitoring, security, and how custom modules survive future upgrades all matter once real data is on the line. For Germany-based companies, add GDPR, accounting workflows, and DATEV requirements to that list.
Final Answer: How Do You Install Odoo on Amazon?
EC2 → Ubuntu 24.04 → PostgreSQL → Odoo 19 → Systemd → Nginx → SSL → Backups → Monitoring. Follow the commands above for development or testing. For a production ERP handling financial, customer, or operational data, I'd get a second pair of eyes on the architecture and security configuration before going live — it's a lot cheaper than fixing it after a breach or a lost database.
If self-hosting on AWS isn't the right fit, Odoo.sh is worth comparing, or get in touch and I'll help you figure out which hosting approach actually matches what you're running.
