Odoo AWS EC2 ERP Hosting DevOps Infrastructure as Code

Hosting Odoo on AWS EC2: Architecture and Best Practices

Discover the best architecture to host your Odoo ERP on AWS EC2. Learn about security groups, EBS volumes, and load balancing.

8 min read

Hosting Odoo on AWS EC2: Best Practices

Odoo EC2 Hosting

Running Odoo on AWS gives you the flexibility to adapt to changing business requirements. An optimal AWS EC2 deployment involves more than simply spinning up a server.


Right-Sizing Your EC2 Instance

Odoo is multi-processed and RAM-heavy.

  • Micro/Small environments (1-5 users): t3.small or t3.medium.
  • Medium environments (10-50 users): t3.large or compute-optimized c5.large.
  • Large environments (50+ users): Consider splitting App and DB tiers with c5.xlarge and RDS.

Storage Layer (EBS)

Your PostgreSQL database (if hosted on the same EC2) and your Odoo filestore reside on disk.

  • Use gp3 volumes instead of gp2 for baseline IOPS and throughput performance regardless of volume size.
  • Ensure automated EBS snapshots are configured via Data Lifecycle Manager (DLM) for daily disaster recovery backups.

Security Groups

A properly configured Security Group acts as your primary firewall.

  • Port 22 (SSH): Only whitelist your corporate IP address or a Bastion Host.
  • Port 80/443 (HTTP/HTTPS): Open to the world (0.0.0.0/0).
  • Port 8069 (Odoo Custom): Block this completely. Use Nginx on Port 80/443 to reverse proxy traffic to 8069.

Implementation via Nginx Reverse Proxy

Never expose the default Odoo port (8069) to the internet. Use an Nginx reverse proxy to handle SSL termination.

upstream odoo {
    server 127.0.0.1:8069;
}

server {
    listen 80;
    server_name erp.yourdomain.com;
    
    location / {
        proxy_pass http://odoo;
    }
}

Add Certbot to generate high-grade Let's Encrypt SSL certificates gracefully.


Separate the Database for High Availability

When scaling, do not host PostgreSQL on the EC2 instance. Migrate to Amazon RDS for PostgreSQL. This separates your stateless app tier from your stateful data tier, allowing you to easily duplicate your EC2 layer behind an Application Load Balancer (ALB).


Conclusion

By adopting AWS best practices around Security Groups, specific EBS volumes, and decoupling components, your Odoo instance will be highly secure, performant, and ready for future growth.

Found this helpful?

We write about what we build. If you need similar solutions for your business, let's talk.