Hey there, so ever thought of having your Odoo ERP on the cloud platform like Amazon. If yes, then this is the perfect page for you. You will not only install the latest Odoo 11 on AWS but will learn to access it without using the port 8069. This blog will help you to install Odoo 11 on AWS Cloud with few simple steps. Not only this, you will configure Nginx Server as well as access your server files using Filezilla Program.

Why Choose AWS EC2 services to run Odoo?

Amazon Elastic Compute Cloud (Amazon EC2) is well known for its flexibility as well as scalability. You can choose to use these benefits of cloud services for your odoo instance. Addition to this, it will also help you with low cost and effective performance of your odoo to improve your business operations. AWS further provides you with a choice to select the working platform for your virtual server.

 

Get started with AWS Management Console

  1. Get started with AWS Management Console. Set up your Amazon AWS account. You can register at here.
  2.  Go to My Account->AWS Management Console. Management Console page will be opened. This helps you to easily manage all your Amazon Services. Next click on services.

    Install-odoo11-console
    AWS Management Console
  3. Now you need to select the service you want from Amazon Server, in our case we need to select EC2 under Compute Menu.
  4. Above step will take you to your EC2 Dashboard where you can see the current statue of your EC2. You can see your running instances, the physical location of your, hosts, elastic IPs etc.

Create Ubuntu instance

1. Next Step is to create a new EC2 instance to host your Odoo. Click on Launch Instance button. Here you will have to select the platform for your instance. Please Select Ubuntu Server.

install-Odoo11-AMI
Amazon Machine Image

2. Next step includes the selection of instance type. You can choose different types based on your application requirement. Select General Purpose t2.micro as your instance type and click on Next: Configure Instance Details.

Install-Odoo11-Instance_type
AWS EC2 Instance Type

3. Next step is to configure your instance for all the network settings only if required else click on Next: Add Storage.

Install-Odoo11-Instance_details
AWS EC2 Instance Details

4. Add Storage lets you choose the amount of storage you required for your instance. Select a size of 8GB and click on Next: Add Tags.

Install-Odoo11-Storage
AWS EC2 Instance Storage

5. Adding tags to your instance will help you manage your resources. A Key-Value pair can be defined as a tag if needed then Click on Next: Configure Security Groups.

Install-Odoo11-Tags
AWS EC2 Instance Tags

6. Configuring Security Groups is an essential step when launching a new instance as it acts a virtual firewall to your instance. Set security name as odoo-security. Next step involves adding all the required protocols. Click on add a new rule and add SSH, HTTP, HTTPS, TCP/Custom.
Please note that custom TCP is set to port 8069 as this will be your odoo default port access. Once done click on Review and Launch.

Install-Odoo11-Security_Group
AWS EC2 Instance Security Group

Launching your instance

Warning: Please do not select Proceed without a key pair option as you will not be able to connect to your instance. Backup this pem key file as your AWS do not provide you to download it for the second time.

Click Launch, a new dialogue box will be opened for selecting a key pair. This will be your private key in pem format. Select Choose a new key pair and give the name as odoo. Download this key pair as it will be needed in later steps.

When you click on Launch Instance following window will be opened and you are done. Your instance is now running on Amazon Server.

Install-Odoo11-Instances-Launch
AWS EC2 Instances Launch

install-Odoo11-Putty

Why do you need to connect to AWS with Putty for windows users or inbuild terminal for mac?

Putty or SSH client allows you to connect to your instance and allows remote secure terminal access. Windows user use Putty and Mac Users use inbuild terminal to connect to your instance. This is done to securely connect to your EC2 ubuntu instance from desktop. sortedodoo.com

Install Putty for the Shell Tunnel Access

1. Download Putty from here.

2. Get your instance Id from your instance details page of AWS dashboard.

Generate a private ppk key using Puttygen

Putty does not support the .pem key file and you need to convert it to .ppk key file. For this, follow the following steps.

1. Download Puttygen and start it.

2. Under the parameter tap, select RSA as your type of key to generate. For older versions of Puttygen, select SSH2-RSA.

Install-Odoo11-Puttygen
Puttygen

3. Click on Load. By default, Puttygen will only allow you to see .ppk files select All files to display other options.

4. Select your odoo.pem file and click on open. PuttyGen Notice will pop-up click on OK.

5. Choose Save Private Key and specify your key pair name as odoo.ppk. Now you have odoo.ppk key to connect to your Putty’s SSH client.

Check Out This Simple Step By Step Guide To Install Odoo 11 On AWS EC2 Click To Tweet

Configure Putty and access your Ubuntu server on AWS

1. Start Putty.

2. Under the Host Name (Or IP Address) enter your Instance’s IP Address and port as 22.

3. Go to Connection -> Data, enter your Autologin Username as ubuntu. 

4. Go to Connection -> SSH -> Auth

5. Browse for your odoo.ppk file and click on ok. Putty will show you a security alert dialogue box to ensure whether you trust the source. Click on Yes.

6. A window will be opened, and you are connected to your instance.

Optional Step– To prevent above steps of configuration every time you connect, you can choose to store all the session informationFollow steps 1 to 6 and click on Session. Type Stored Session Name and Click on Store.

 

Install-Odoo11-Server

Install odoo 11 on AWS Server

1. Update and Upgrade Servers

sudo apt-get update
sudo apt-get upgrade -y

2. Install PostgreSQL Server

sudo apt-get install postgresql -y

3. Create Postgre User as Odoo

sudo su - postgres -c "createuser -s odoo" 2> /dev/null || true 

4. Install Dependencies

sudo apt-get install python3 python3-pip

sudo apt-get install wget git bzr python-pip gdebi-core -y

sudo apt-get install python-pypdf2 pythondateutil python-feedparser python-ldap pythonlibxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi pythondocutils python-psutil python-mock pythonunittest2 python-jinja2 python-pypdf pythondecorator python-requests python-passlib python-pil -y

sudo pip3 install pypdf2 Babel passlib Werkzeug decorator python-dateutil pyyaml psycopg2 psutil html2text docutils lxml pillow reportlab ninja2 requests gdata XlsxWriter vobject python-openid pyparsing pydot mock mako Jinja2 ebaysdk feedparser xlwt psycogreen suds-jurko pytz pyusb greenlet xlrd< /code>

5. Install Python Libraries and other packages

sudo apt-get install python3-suds

sudo apt-get install node-clean-css -y

sudo apt-get install node-less -y

sudo apt-get install python-gevent -y 

6. Install wkhtmltopdf

sudo apt-get install wkhtmltopdf 

7. Create ODOO system user

sudo adduser --system --quiet -- shell=/bin/bash --home=/odoo --gecos 'ODOO' --group odoo 

sudo adduser odoo sudo 

8. Create Log File

sudo mkdir /var/log/odoo

sudo chown odoo:odoo /var/log/odoo 

9. Install Odoo Server

sudo git clone --depth 1 --branch 11.0 https://www.github.com/odoo/odoo /odoo/odoo-server/ 

10. Create custom module directory

sudo su /odoo -c "mkdir /odoo/custom"

sudo su odoo -c "mkdir /odoo/custom/addons"

11. Set permission to Odoo folder

sudo chown -R odoo:odoo /odoo/*

12. Create server config file odooserver.conf at /etc directory

sudo nano /etc/odoo-server.conf 

Paste the following content.


[options] ; This is the password that allows database operations:
admin_passwd = admin
xmlrpc_port = 8069
logfile = /var/log/odoo/odoo-server.log
addons_path = /opt/odoo/addons,/opt/odoo/odoo/addons

13. Set permission to config file

sudo chown odoo:odoo /etc/odooserver.conf

sudo chmod 640 /etc/odoo-server.conf 

14. Create startup file

sudo su root -c "echo '#!/bin/sh' >> /odoo/odoo-server/start.sh"
sudo su root -c "echo 'sudo -u odoo /odoo/odoo-server/openerp-server --config=/etc/odoo-server.conf' >> /odoo/odoo-server/start.sh"
sudo chmod 755 /odoo/odooserver/start.sh 

15. Odoo Deamon file


cat < ~/odoo-server
#!/bin/sh
### BEGIN INIT INFO
# Provides: odoo-server
# Required-Start: \$remote_fs \$syslog
# Required-Stop: \$remote_fs \$syslog
# Should-Start: \$network
# Should-Stop: \$network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Enterprise Business Applications
# Description: ODOO Business Applications
### END INIT INFO
PATH=/bin:/sbin:/usr/bin
DAEMON=/odoo/odoo-server/odoo-bin
NAME=odoo-server
DESC=odoo-server
# Specify the user name (Default: odoo).
USER=odoo
# Specify an alternate config file (Default: /etc/openerp-server.conf).
CONFIGFILE="/etc/odoo-server.conf"
# pidfile
PIDFILE=/var/run/\${NAME}.pid
# Additional options that are passed to the Daemon.
DAEMON_OPTS="-c \$CONFIGFILE"
[ -x \$DAEMON ] || exit 0
[ -f \$CONFIGFILE ] || exit 0
checkpid() {
[ -f \$PIDFILE ] || return 1
pid=\`cat \$PIDFILE\`
[ -d /proc/\$pid ] && return 0
return 1
}
case "\${1}" in
start)
echo -n "Starting \${DESC}: "
start-stop-daemon --start --quiet --pidfile \$PIDFILE \
--chuid \$USER --background --make-pidfile \
--exec \$DAEMON -- \$DAEMON_OPTS
echo "\${NAME}."
;;
stop)
echo -n "Stopping \${DESC}: "
start-stop-daemon --stop --quiet --pidfile \$PIDFILE \
--oknodo
echo "\${NAME}."
;;
restart|force-reload)
echo -n "Restarting \${DESC}: "
start-stop-daemon --stop --quiet --pidfile \$PIDFILE \
--oknodo
sleep 1
start-stop-daemon --start --quiet --pidfile \$PIDFILE \
--chuid \$USER --background --make-pidfile \
--exec \$DAEMON -- \$DAEMON_OPTS
echo "\${NAME}."
;;
*)
N=/etc/init.d/\$NAME
echo "Usage: \$NAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
EOF

16. Security Init File

sudo mv ~/odoo-server /etc/init.d/odooserver 

sudo chmod 755 /etc/init.d/odoo-server 

sudo chown root: /etc/init.d/odoo-server 

17. Start Odoo on startup

sudo update-rc.d odoo-server defaults

18. Start the Odoo-service

sudo su root -c "/etc/init.d/odoo-server start"

Install-Odoo11-NginxSetting Up A Proxy Server Using Nginx

1. Install Nginx Server

apt-get install nginx 

2. Edit the configuration file

nano /etc/nginx/sites-enabled/default

3. Go to End of File and uncomment following four lines and enter your instance IP address and/or Domain name.

Server 
  { 
    Listen 80;
    Server_name Your_IP_Address ; 
    Root /var/www/example.com; 

4. Paste the following contain at EOF and check for the brackets.

location / {
proxy_pass http://127.0.0.1:8069;
proxy_redirect off;
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;
}
}

6. Restart your Nginx Server

/etc/init.d/nginx restart 

7. Test the connection by simply placing only your IP address in your web browser. If successful you will be directed to your odoo login page.

 Install-Odoo11-Filezilla

File management using Filezilla

Filezilla is easy to use, fast and reliable cross-platform, FTP, FTPS and SFTP management software. It supports various file transfer protocols like FTP, FTP over SSL/TLS(FTPS) and SSH File Transfer. It has numerous benefits like drag and drop, Directory Comparison, remote file editing and many more.

 

Install and Configure Filezilla
1. Install Filezilla from here.

2. Go to Edit ->Settings.

3. Under the Connection tab, go to SFTP and add odoo.ppk as your key file. Once done click on OK.

4. Next click on Site Manage Icon in the lefthand corner or File -> Site Manager.

Install-Odoo11-Filezilla-Site-Manager
Filezilla Site Manager

5. In Site Manager dialogue box, Click on New Site.

6. Enter Your Host IP i.e. your instance ID.

7. Select Protocol as SFTP- SSH File Transfer Protocol.

8. Select login Type as normal.
Username: ubuntu
Password: admin

Install-Odoo11-Filezilla-Configuration
Filezilla Configuration

9. Go to your Instance to edit inbound rules or the security group odoo. Add new SSH rule change source to My IP and save the changes.

10. In Filezilla, Click on Connect. Now you are connected to your AWS instance. You can access your ubuntu files directories from FileZilla.

So, don’t you think this was simple? Odoo is amazing and it is perfect when accompanied by Amazon AWS.

Still, Need Help? Get the Odoo installation script and learn the easiest way to install Odoo 11 on AWS EC2 with this step by step video tutorial. You can get 80% Copoun with this link.



Also published on Medium.

27 COMMENTS

    • Hey Cesar, thanks for the comment.

      To configure RDS managed DB with Odoo running on EC2 instance, you will just need to copy the original database to RDS and update Odoo Config file with RDS host and user details to use new RDS DB.

      We will try to add a separate guide for the same soon. Thank you!

  1. Hi,

    Thank you very much, when I run the below command to do step 4. Install Dependencies :

    sudo apt-get install python-pypdf2 pythondateutil python-feedparser python-ldap pythonlibxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi pythondocutils python-psutil python-mock pythonunittest2 python-jinja2 python-pypdf pythondecorator python-requests python-passlib python-pil -y

    I got the below message:

    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package pythondateutil
    E: Unable to locate package pythonlibxslt1
    E: Unable to locate package pythondocutils
    E: Unable to locate package pythonunittest2
    E: Unable to locate package pythondecorator

    Could you please help me to fix it

    • Hi Hayes, which server setting are you using? This error is most likely due to disabled dependencies for the packages. First, just try updating the server using sudo apt-get update and then upgrade using sudo apt-get upgrade. Then try to install those packages one by one. If this doesn’t solve the issue. Please enable the ubuntu package dependencies needed. Hope it helps. Cheers!

      • I think the package name has been changed. The same error occurred when I run that command. I have to change the name of package like pythondateutil to python-dateutil.

        • This worked for me, i let it hear for others how will have the same problème of package name changed :

          sudo apt-get install python-pypdf2 python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests python-passlib python-pil -y

  2. Hi
    Thanks for the guide, I am a newbie and stuck at Point No 4 Install Dependencies. The last command

    sudo pip3 install pypdf2 Babel passlib Werkzeug decorator python-dateutil pyyaml psycopg2 psutil html2text docutils lxml pillow reportlab ninja2 requests gdata XlsxWriter vobject python-openid pyparsing pydot mock mako Jinja2 ebaysdk feedparser xlwt psycogreen suds-jurko pytz pyusb greenlet xlrd

    gave the error: syntax error near unexpected token ‘newline’
    Any idea what is wrong?
    Thanks in advance

  3. Hi Again
    At point no 18 “start the odoo service”, I am getting the following error
    /etc/init.d/odooserver: 63: /etc/init.d/odooserver: syntax error : newline unexpected (expecting “)”)
    I have tried to check for any newline or enter in the code but could not find what the problem is (I am not well acquainted with coding). Can you please check whether the code is working at your end.

  4. Hi,

    Firstly thanks for nice documentation and your time.

    1)At step 7, (creating a new user) there is an error on your code. I tried to figure that out more than half hour. There is a space in front of shell. It supposed to be –shell instead of — shell. If you can fix it out others won’t struggle at that point anymore 🙂

    2)I am not sure why did you created a new user and set everything on that user but it was kinda pain in the neck for me.

    On step 10 sudo su /odoo -c "mkdir /odoo/custom" I am getting an error “No passwd entry for user ‘/odoo’ “. So I tried to create the directory under ubuntu user but this time I got other errors on next steps since it couldnt access to that folder as user odoo. It gave me the error no such file or directory. I decided to connect to user odoo directly through ssh and create that directory while I am logged in as odoo but this time I started to struggle to connect via ssh through user odoo because I couldn’t use the same ssh-key that I generated for user ubuntu and decided to not try to go around this steps anymore and posting this comment right now.

    Do you have any idea why I am getting this error? Also I am curious of the reason that you did everything under another user instead of the user that we logged in on ssh connection.

  5. Hi how are you. I have a problen in step 4. Install Dependencies, when I write the second line:

    sudo pip3 install pypdf2 Babel passlib Werkzeug decorator python-dateutil pyyaml psycopg2 psutil html2text docutils lxml pillow reportlab ninja2 requests gdata XlsxWriter vobject python-openid pyparsing pydot mock mako Jinja2 ebaysdk feedparser xlwt psycogreen suds-jurko pytz pyusb greenlet xlrd

    The answer is:

    -bash: syntax error near unexpected token `newline’

    I don´t know what I doing bad. I appreciate your help,

    Thank You

  6. Hi,
    I am stuck at point 14. Create startup file

    sudo su root -c “echo ‘#!/bin/sh’ >> /odoo/odoo-server/start.sh”

    It gives error: -bash: !/bin/sh’: event not found
    any idea what to do here? Really appreciated.

  7. Hi,
    I am stuck at point 14. Create startup file

    sudo su root -c “echo ‘#!/bin/sh’ >> /odoo/odoo-server/start.sh”

    It gives error: -bash: !/bin/sh’: event not found
    any idea what to do here? Really appreciated.

    Regards,
    Rubab Fatima

      • that sentence work and the next, but when I put the third sentence
        <>
        ubunto said:
        <>
        the oder sentence is:

        [sudo su root -c “echo ‘sudo -u odoo /odoo/odoo-server/openerp-server –config=/etc/odoo-server.conf’ >> /odoo/odoo-server/start.sh” ]

LEAVE A REPLY

Please enter your comment!
Please enter your name here