{"id":17293789,"url":"https://github.com/yohanavishke/ec2-odoo-setup","last_synced_at":"2026-02-03T14:02:38.752Z","repository":{"id":186639856,"uuid":"351149240","full_name":"YohanAvishke/ec2-odoo-setup","owner":"YohanAvishke","description":"All the steps to setup a community version of Odoo on a free EC2 instance","archived":false,"fork":false,"pushed_at":"2022-12-01T16:33:31.000Z","size":60,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-24T21:06:52.147Z","etag":null,"topics":["aws-ec2","ec2","ec2-odoo-setup","guide","odoo","ubuntu"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YohanAvishke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-03-24T16:26:59.000Z","updated_at":"2024-05-01T14:23:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"0dba2c0a-3797-4113-a8f7-dc7fae600f46","html_url":"https://github.com/YohanAvishke/ec2-odoo-setup","commit_stats":null,"previous_names":["yohanavishke/ec2-odoo-setup"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YohanAvishke/ec2-odoo-setup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YohanAvishke%2Fec2-odoo-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YohanAvishke%2Fec2-odoo-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YohanAvishke%2Fec2-odoo-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YohanAvishke%2Fec2-odoo-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YohanAvishke","download_url":"https://codeload.github.com/YohanAvishke/ec2-odoo-setup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YohanAvishke%2Fec2-odoo-setup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29047076,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T10:09:22.136Z","status":"ssl_error","status_checked_at":"2026-02-03T10:09:16.814Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-ec2","ec2","ec2-odoo-setup","guide","odoo","ubuntu"],"created_at":"2024-10-15T10:48:54.668Z","updated_at":"2026-02-03T14:02:38.722Z","avatar_url":"https://github.com/YohanAvishke.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# EC2 Odoo setup\nAll the steps to setup a community version of Odoo on a free EC2 instance\n\n# EC2\nOnly this step is EC2 specific. Rest can be used with any VPN provider.\n## Prerequisites\nFollow the [tutorial](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/get-set-up-for-amazon-ec2.html) to setup the EC2 prerequisites. Names and configs used,\n - **Region:** `ap-south-1` (use closest region for the users)\n - **Key Pair:** `groundstation-ec2-access-key-ap-south-1`\n - **Security Group** \n   - **Name:** `yohan_SG_apsouth1`\n   - **Inbound Rules:** Type: `Custom TCP` - Port: `8069`\n - **Storage:** 20GiB ([Guide to expand an existing storage size](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html#extend-file-system))\n\n## Setup\nFollow the [tutorial](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html) to launch the instance. Names and configs used,\n - **OS type:** Ubuntu Server 20.04 LTS (HVM), SSD Volume Type\n - **Processor:** 64 bit (x86)\n - **Storage:** 8GB\n\n## Connect\nDownload and store the `.pem/.cert` file in `.ssh` directory. Use the following command to connect,\n\n```\nssh -i groundstation-ec2-access-key-ap-south-1.cer ubuntu@|██████|.ap-south-1.compute.amazonaws.com\n```\n\n\n# Odoo\n## Prerequisites\nUpdate the server dependancies.\n```\nsudo apt-get update\nsudo apt-get upgrade -y\n```\nInstall pip3 package manager.\n```\nsudo apt install python3-pip -y\n```\nInstall venv dependency.\n```\nsudo apt-get install python3-venv -y\n```\nInstall PostgreSQL.\n```\nsudo apt install postgresql postgresql-client -y\n```\nInstall rest of the development tools and native dependencies.\n```\nsudo apt install -y \\\npython3-dev libxml2-dev libxslt1-dev libldap2-dev \\\nlibsasl2-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev \\\nzlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev \\\nlibharfbuzz-dev libfribidi-dev libxcb1-dev libpq-dev\n```\nInstall wkhtmltopdf for headers and footers support.\n```\nsudo apt-get install wkhtmltopdf -y\n```\n\n## Installation\nCreate System user.\n```\nsudo useradd -m -d /opt/odoo -U -r -s /bin/bash odoo\n```\nSetup a password for user (Make sure to remember the password).\n```\nsudo passwd odoo\n```\nCreate a new PostgreSQL user.\n```\nsudo -u postgres createuser -s odoo\n```\nChange user to Odoo user.\n```\nsudo su - odoo\n```\nDownload Odoo from GIT\n```\ngit clone https://github.com/odoo/odoo.git /opt/odoo/odoo14\n```\nCreate a Virtual environment and activate it.\n```\ncd /opt/odoo/odoo14\npython3 -m venv venv\nsource venv/bin/activate\n```\nComment-out `libsass==0.17.0` from `requirements.txt`, since it gets stuck in the build stage.\nExecute follow command to fix `libsass` issue.\nBut, beware, `0.20.0` does not work with Odoo Studio App.\n```\npip3 install libsass==0.20.0\n```\nInstall Python dependancies from pip.\n```\npip3 install setuptools wheel\npip3 install -r requirements.txt\n```\nCreate custom addons directory.\n```\nmkdir /opt/odoo/odoo14/custom-addons\n```\nAfter the installation deactivate the virtual environment and logout.\n```\ndeactivate\nexit\n```\n\n## Startup\nStartup Odoo by provideing custom addon path and database.\n```\npython3 odoo-bin --addons-path=addons -d odoo\n```\nOdoo dashboard: [http://████.ap-south-1.compute.amazonaws.com:8069](http://████.ap-south-1.compute.amazonaws.com:8069)\n\n\n# As a Background service\n## Prerequisites\nCreate a custom configuration file.\n```\nmkdir /etc/odoo\nsudo vim /etc/odoo/odoo14.conf\n```\nPaste following content in the file.\n```\n[options]\naddons_path = /opt/odoo/odoo14/addons,/opt/odoo/odoo14/custom-addons\n; This is the password that allows database operations:\nadmin_passwd = z92v-h3te-bqjm\ndb_host = False\ndb_port = False\ndb_user = odoo\ndb_password = False\nlimit_time_cpu = 150\nlimit_time_real = 300\n```\nCreate Systemd Unit File.\n```\nsudo vim /etc/systemd/system/odoo14.service\n```\nPaste following content in the file.\n```\n[Unit]\nDescription=Odoo14\nRequires=postgresql.service\nAfter=network.target postgresql.service\n\n[Service]\nType=simple\nSyslogIdentifier=odoo14\nPermissionsStartOnly=true\nUser=odoo\nGroup=odoo\nExecStart=/opt/odoo/odoo14/venv/bin/python3 /opt/odoo/odoo14/odoo-bin -c /etc/odoo/odoo14.conf\nStandardOutput=journal+console\n\n[Install]\nWantedBy=multi-user.target\n```\n\n## Startup\nReload the Systemd to create the service.\n```\nsudo systemctl daemon-reload\n```\nStart the Odoo service.\n```\nsudo systemctl start odoo14\n```\n(optional) Start the Odoo service and enabled it to start on boot by running\n```\nsudo systemctl enable --now odoo14\n```\nCheck the status of the service.\n```\nsudo systemctl status odoo14\n```\nView the Odoo log.\n```\nsudo journalctl -n 50 -f -u odoo14\n```\nStop the Odoo service.\n```\nsudo systemctl stop odoo14\n```\n(optional) Stop the Odoo service and disable it from running on startup.\n```\nsudo systemctl disable --now odoo14\n```\n\n\n# Nginx\n## Installation\nLogin as a root user. If root following command should display `root`.\n```\nsudo whoami\n```\nDownload and Install Nginx\n```\nsudo apt install nginx -y\n```\nVerify if the service is up and running (`Active: active (running)`)\n```\nsudo systemctl status nginx\n```\n\n## Firewall setup\n(Optional) Setup a firewall using `UFW`. \nNot required since EC2 provide security groups. but,\n\u003e \"Having both is more secure and they can complement each other, \n\u003e `IPTables` (or any other firewall) allows you to log posible atacks and even you can add dynamic rules\"\n\n[View Guide](https://linuxize.com/post/how-to-install-nginx-on-ubuntu-20-04/#configuring-firewall) \n\n\n# Securing Nginx by SSL\nInstall a free Let’s Encrypt SSL certificate and configure Nginx to use the SSL certificate and enable HTTP/2.\n## Installation\nInstall `Certbot` to automates the tasks for obtaining and renewing SSL certificates and configuring web servers to use the certificates.\n```\nsudo apt install certbot -y\n```\n\n## Obtaining SSL certificate\nGenerate a new set of 2048 bit DH(Diffie–Hellman key exchange) parameters.\n```\nsudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048\n```\nMake a directory to verify that the requested domain resolves to the server where certbot runs(using `Webroot` plugin).\n```\nsudo mkdir -p /var/lib/letsencrypt/.well-known\n```\nMake the directory writable by Nginx server.\n```\nsudo chgrp www-data /var/lib/letsencrypt\nsudo chmod g+s /var/lib/letsencrypt\n```\nCreate 2 files to include base snippets for all Nginx server blocks.\n1. `sudo vim /etc/nginx/snippets/letsencrypt.conf`\n   ```\n   location ^~ /.well-known/acme-challenge/ {\n     allow all;\n     root /var/lib/letsencrypt/;\n     default_type \"text/plain\";\n     try_files $uri =404;\n   }\n   ```\n2. `sudo vim /etc/nginx/snippets/ssl.conf` - Chippers recommended by Mozilla, Enables OCSP Stapling, HTTP Strict Transport Security (HSTS) and Enforces few security‑focused HTTP headers.\n   ```\n   ssl_dhparam /etc/ssl/certs/dhparam.pem;\n\n   ssl_session_timeout 1d;\n   ssl_session_cache shared:SSL:10m;\n   ssl_session_tickets off;\n\n   ssl_protocols TLSv1.2 TLSv1.3;\n   ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;\n   ssl_prefer_server_ciphers on;\n\n   ssl_stapling on;\n   ssl_stapling_verify on;\n   resolver 8.8.8.8 8.8.4.4 valid=300s;\n   resolver_timeout 30s;\n\n   add_header Strict-Transport-Security \"max-age=31536000; includeSubDomains\" always;\n   add_header X-Frame-Options SAMEORIGIN;\n   add_header X-Content-Type-Options nosniff;\n   ```\nCreate the domain server block file.\n```\nsudo vim /etc/nginx/sites-available/██████.ap-south-1.compute.amazonaws.com.conf\n```\nAdd following code to the file.\n```\nserver {\n  listen 80;\n  server_name ██████.ap-south-1.compute.amazonaws.com www.██████.ap-south-1.compute.amazonaws.com;\n\n  include snippets/letsencrypt.conf;\n}\n```\nEnable the new server block by creating a symbolic link to `sites-enabled` directory.\n```\nsudo ln -s /etc/nginx/sites-available/.██████.ap-south-1.compute.amazonaws.com.conf /etc/nginx/sites-enabled/\n```\n(Optional) Add support for long domain names (Available sizes 64, 128, 256, 512, etc.)\n```\nsudo vim /etc/nginx/nginx.conf\n\nhttp {\n        ...\n        server_names_hash_bucket_size 128;\n        ...\n```\nUpdate the Nginx session with the changes.\n```\nsudo systemctl restart nginx\n```\n\n\n\n\n\nObtain the SSL certificate files through Certbot with the webroot plugin.\n```\nsudo certbot certonly --agree-tos --email yaediriweera@gmail.com,multibajaj555@gmail.com --webroot -w /var/lib/letsencrypt/ -d ec2-65-0-138-234.ap-south-1.compute.amazonaws.com -d www.ec2-65-0-138-234.ap-south-1.compute.amazonaws.com\n```\n\n```\nsudo nano /etc/nginx/sites-available/ec2-65-0-138-234.ap-south-1.compute.amazonaws.com.conf\n```\nAdd following code to the file.\n```\nserver {\n    listen 80;\n    server_name www.ec2-65-0-138-234.ap-south-1.compute.amazonaws.com ec2-65-0-138-234.ap-south-1.compute.amazonaws.com;\n\n    include snippets/letsencrypt.conf;\n    return 301 https://$host$request_uri;\n}\n\nserver {\n    listen 443 ssl http2;\n    server_name www.example.com;\n\n    ssl_certificate /etc/letsencrypt/live/ec2-65-0-138-234.ap-south-1.compute.amazonaws.com/fullchain.pem;\n    ssl_certificate_key /etc/letsencrypt/live/ec2-65-0-138-234.ap-south-1.compute.amazonaws.com/privkey.pem;\n    ssl_trusted_certificate /etc/letsencrypt/live/ec2-65-0-138-234.ap-south-1.compute.amazonaws.com/chain.pem;\n    include snippets/ssl.conf;\n    include snippets/letsencrypt.conf;\n\n    return 301 https://ec2-65-0-138-234.ap-south-1.compute.amazonaws.com$request_uri;\n}\n\nserver {\n    listen 443 ssl http2;\n    server_name ec2-65-0-138-234.ap-south-1.compute.amazonaws.com;\n\n    ssl_certificate /etc/letsencrypt/live/ec2-65-0-138-234.ap-south-1.compute.amazonaws.com/fullchain.pem;\n    ssl_certificate_key /etc/letsencrypt/live/ec2-65-0-138-234.ap-south-1.compute.amazonaws.com/privkey.pem;\n    ssl_trusted_certificate /etc/letsencrypt/live/ec2-65-0-138-234.ap-south-1.compute.amazonaws.com/chain.pem;\n    include snippets/ssl.conf;\n    include snippets/letsencrypt.conf;\n}\n```\nUpdate the Nginx session with the changes.\n```\nsudo systemctl reload nginx\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyohanavishke%2Fec2-odoo-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyohanavishke%2Fec2-odoo-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyohanavishke%2Fec2-odoo-setup/lists"}