Setting up Odoo 12.0 (Community Edition) om Amazon Lightsail

Submitted by mshannaq on Sat, 03/30/2019 - 03:56

After choosing Ubuntu 18.04 (LTS) and creating the lightsail instance and give the new instance a public static IP login to server ssh and try to update and upgrade ubuntu first using

$ sudo apt-get upgrade
$ sudo apt-get update

Create a Swap file if you think your server need a swap file.

I will use https://github.com/Yenthe666/InstallScript/ or https://github.com/mshannaq/InstallScript/ for odoo installation and Ir will install odoo 12 

$ sudo -s

# cd /root/

# wget https://raw.githubusercontent.com/mshannaq/InstallScript/12.0/odoo_install.sh

IF you are using odoo on ubuntu 18,04 bionic then  you are adviced to  check odoo_install.sh contents and change

WKHTMLTOX_X64=https://downloads.wkhtmltopdf.org/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
to
WKHTMLTOX_X64=https://builds.wkhtmltopdf.org/0.12.1.3/wkhtmltox_0.12.1.3-1~bionic_amd64.deb

# chmod +x odoo_install.sh
# sudo bash odoo_install.sh

After  running odoo_install.sh finished you will get

-----------------------------------------------------------
Done! The Odoo server is up and running. Specifications:
Port: 8069
User service: odoo
User PostgreSQL: odoo
Code location: odoo
Addons folder: odoo/odoo-server/addons/
Start Odoo service: sudo service odoo-server start
Stop Odoo service: sudo service odoo-server stop
Restart Odoo service: sudo service odoo-server restart
-----------------------------------------------------------

Then we must install some important libraries so we run the commands:

$ sudo apt install libpng-dev
$ cd /usr/local/src
$ wget http://ftp.fr.debian.org/debian/pool/main/libp/libpng/libpng12-0_1.2.50-2+deb8u3_amd64.deb
$ sudo dpkg -i libpng12-0_1.2.50-2+deb8u3_amd64.deb

After that we allow lightsail instance to be accessed from the port 8069 by going to amazon lightail networking configuration page and add the port TCP 8060 to allow.

To Enable PDF reports in odoo12 CE  (I will use https://apps.odoo.com/apps/modules/12.0/accounting_pdf_reports/) , run the following commands:

$ sudo cd /odoo/odoo-server/addons

$ sudo wget https://www.dropbox.com/s/9nv0x0o213v4r7n/accounting_pdf_reports-12.0.1.0.0.zip?dl=0

$ sudo mv accounting_pdf_reports-12.0.1.0.0.zip\?dl\=0 accounting_pdf_reports-12.0.1.0.0.zip

$ sudo apt-get install unzip

$ unzip accounting_pdf_reports-12.0.1.0.0.zip

$ chown -R odoo:odoo accounting_pdf_reports/

$ rm accounting_pdf_reports-12.0.1.0.0.zip

login to odoo and activate devloper mode > goto to app > and choose update app list from the navbar of apps
then restart install the accouting_pdf_report module and then restart odoo service

$sudo service odoo-server restart

 

As security is a very big topic I did not add anything about security in this blog post. Please do configure your Odoo with a firewall, Nginx, SSL and best security practices. I advice you to take a look to the following checklist https://www.odoo.com/forum/help-1/question/how-to-increase-the-security-of-odoo-90135

To use odoo over HTTPS I advice you to take a look of the following URL https://linuxize.com/post/how-to-deploy-odoo-12-on-ubuntu-18-04/ which talk how to use nginx as reverse proxy of odoo 12 to provide SSL.

 

Add new comment