Categories
DOCKER Odoo Synology

Installing Odoo14 on a Synology (using Docker)

In this blog I will show you how to install Odoo version 14 on your Synology NAS. I have another post where I installed Odoo 13 on Synology and this is an updated version for the version 14, posted in october 2020.

Docker is amazing. Odoo is also amazing. It’s a cool open source ERP project which keeps adding cool functionality, initially known as openERP.

They also have a paid solution which is hosted at their servers and you will get access to all functionallity with a Mobile App.

The free version however is fully functional and great to use as a test, development or sandbox environment.

Lets get started.

Step 1. Login to you Synology NAS

Log into your synology nas. Do I need to say more? Business As Usual I expect :-).

Loginscreen Synology NAS

Step 2. Install or Start Docker

If you have an older NAS (for this blog post I’m using the Synology 710+) you have to install the Docker package first. Open the Package Center, search for docker and install the package.

Synology NAS Package Center

If you have a modern Synology NAS you will have the Docker package installed per default. You can then just hit Menu, next Docker. The dockerscreen will now appear. If you cannot find the Docker Package, please check if you NAS is supported on the Synology website.

Synology Docker Management Screen

Step 3. Download Docker Images

The Odoo installation will consist of two docker containers. One container will hold the database and the second container will hold the Application. The data will be persistent on you NAS. Synology has created a Docker share where you can store data.

We can start a container from an image. Lets start by downloading the images. We do this by searching the docker hub. This is configured by default in your Synology.

Download the odoo image:

Search for odoo in the docker hub

Click on download to select the version you want. In our case we want version Odoo version 14.

Download Odoo version 14 Image

Next we will search in the Register for ‘postgres’. Postgres is an open source database solution that is popular among many projects.

Search for it and press Download. For Postgres we will choose the latest version (latest Tag).

Download latest version of Postgres

We are now complete and have downloaded everything we need to our Synology NAS, at least, when the download is finished. You can monitor that in the images tab.

Overview of downloaded images that you can use for creating a container

Lets start and spin up some containers :-). A container is created from an image. Adding some parameters can customize it. Once created you can start and stop it individually.

Step 4. Start Database – Postgres

In the image tab, select Postgres, then click Launch. The first thing we need to do is give it a good name. We don’t have to expose ports because this database will not be reachable outside the Docker network.

Give the container a good name

Next we can provide limitations to the container, you can play around with that later, or not. You can also create a shortcut on the desktop. You can do that and that is a perfect assignment for when you want to do it again.

Limit the container and create a shortcut

On the summary screen, check the ‘Run this container after the wizard is finished’

Create database container Summary

Before we can apply we need to add some environment variables. This will configure the database to your needs. In this example we set three variables: POSTGRES_USER. POSTGRES_PASSWORD and POSTGRES_DB. These are the default settings of the Odoo image that we are using so we don’t need this configuration there.

Setup postgres environment variables

If you want you data to persist (meaning it will not be gone when you delete this container) you can add a volume within Advance Settings. Below is an example where the data will be stored in /docker/odoo-pgdata on the NAS. If you just want to play around, leave it as it is.

Mount a file inside the docker container

For now we will leave that so we go to the summary postgres screen.

Postgress Summary Screen

After clicking apply, the container will try to start immediately. You can check the status of the container going to the Container tab.

Overview of running postgres container

This all seems oke, and we now have successfully installed a postgress database with (maybe) no knowledge of postgres, linux or docker. How great is that?

Step 5. Start Odoo 14

Now that you already had such a thorough walkthrough, the Odoo container we’ll do a little bit more compact. Click on the image and press Launch.

To be able to access the container we need to expose a port from inside the container to the outside. Add 8069 as local and container port.

Create the Odoo container

Skip step 2 of the Docker wizard. After clicking next we can start configuring the advanced settings.

The odoo container will look for the hostname db for the connection. It’s built into the odoo image. However our container is called odoo-postgres so we have to make a link in the wizard.

Creating a link from db to odoo-postgres

With this link created the container is almost ready to start. Check the ‘Run this container after the wizard is finished’ and press apply.

Container Odoo 14 Summary

To monitor the status of the odoo application go to the container tab. The container and the application should start in a couple of seconds.

Overview Docker Containers

We are now done with out activities. We have now installed a postgres database and an Odoo container that can connect to the database by providing a link to it. You did this without the need to know anything about linux, databases or installation scripts :-). Very good.

Step 6. Test Odoo Installation

Time to test the application. Goto the ip address of you Synology and add goto the exposed port. In our case this is 8069. After a clouple of seconds you should get the following screen where you can start you Odoo adventure.

The first time it failed with me with that port, what I did was have docker map the ports, once that worked, I put it back to the 8069 port.

Odoo 14 First time start page

Further reading

More information on the specific docker images and their parameters can be found below.

Docker images

Postgreshttps://hub.docker.com/_/postgres
Odoohttps://hub.docker.com/_/odoo
Links to the different docker images

Hope you enjoyed this, step by step instruction to get up and running with Odoo and Docker. Did you try it, did I mis a step, let me know in the comments.

While you are here, drop your email address so I can mail you upon a new awesome post.

Subscribe to my newsletter!

By Stuart Eight

Love automation and virtualisation. Have a passion for programming.

34 replies on “Installing Odoo14 on a Synology (using Docker)”

Hi stuart,

I tried to follow your steps installing docker, postgres and odoo 14 on synology nas. My synology is DS1817+ . After i install postgres in docker, i start the container it will automaticly closed. Any solution for this problem?

Thank you
Helmi

You can have a look at the logging, double click on the container, logging tab. Maybe you forgot to put in POSTGRES_USER, POSTGRES_PASSWORD and POSTGRES_DB from Step 4?

Try not touse the Execution commands that you see on the postgre config. do not use them.
I had the same issue…I tryed it without this “/usr/bin/……..xxx
Now it works.

But now I have the problem, after creat ddbb under oddo web, the app asked for login…did it…..but: the web site is all time blank!, no reaction anymore…..

!?!!¿!?!

Even it’s been my first time configuring it, following your steps made it easy and all is working perfectly.

I have a question though:

How can I make backups of Odoo configurations and contents (database…).

I’ve linked the postgres to a folder inside docker, but I’ve not done it with odoo.

Is it enough to backup the linked database folders?

And a comment on the tutorial, there are spaces after the _ in the environment variables in your tutorial (marked in green).

Thank you in advance!

I think for the database it’s oke. For the odoo you could map the following directories as well:

– /docker/odoo-web-data:/var/lib/odoo
– /docker/odoo-config:/etc/odoo
– /docker/odoo-addons:/mnt/extra-addons

Hope this helps a bit.

Thank you for your great information. You mentioned that you only would recommed the self hosted odoo for development and/or testing. That implies that you wouldn’t recommend it for a business solution. Why is that?

Hi Manuel,

In my reply to Joan I already added some additons for making sure you can safeguard your installation. I think you can use it for production if you have set your synology up in a production manner. Off course this depends on the use case.

A few examples:
– have a mirror of the data in case a disk fails
– have a backup in case someone deletes the data
– have all connections work through SSL so it’s secure
– have a second backup in case the synology burns

If you set this up, at least the first 3 items I think you should be oke to run it on your synology for lots of use cases.

Kind regards,
Stuart

I just wanted to share my gratitude for explaining this setup.
It works like an absolute charm an will help my small shop evolve to 2021 😉

Heel erg bedankt voor je uitleg. Voor mij een mooie eerste stap naar een modernere manier van werken in mijn winkel.

Small question though. As a test I removed some orders and products.
After that I restored an earlier Hyper backup of folder odoo-pgdata.
But for some reason the data is not restored?

Thanks for your reply!
Well, I created the volume as per instructions /docker/odoo-pgdata which points to var/lib/postgresql/data.
The volume is indeed populated. Hyper backup points to that folder.
However copying an older version back to that docker/doo-pgdata folder doesn’t restore an older state of Odoo and it’s contents.

I tried a backup module (from yenthe) but failed to install since it need dependencies (Paramiko and pysftp for example). I have no clue how to add those those to the container…

Hi, I’m not sure if others encountered the same issue as me, but I found the following issue:
After setting everything up successfully and using it for days on end, I rebooted the Synology NAS.
Afterwards, the odoo app container fails to reconnect to the postgres container, with the following error:
Database connection failure: could not connect to server: Connection refused
Is the server running on host “172.17.0.4” and accepting
TCP/IP connections on port 5432?

the Postgres container log shows:
listening on IPv4 address “0.0.0.0”, port 5432

The IP 172.17.0.4 appeared in the odoo.conf file

Any idea why the two container don’t find together again, after a NAS reboot, and how to fix this?

Hi Stuart,

How to configure the reverse proxy toll provided by Synology under Control Panel/ Application Portal / Reverse Proxy, in order to have the HTTPS connection? The SSL Certificate is already configured. The Security / External Access / Router config. is already configured. The Reverse Proxy is configured, but it doesn’t open the right page, just an error page from Synology. Thank you.
Martin

Hi Martin,
Seems like your setup is pretty oke. What you can try is adding additional config to the installation.
This mount you already have for the db data:
– /docker/odoo-pgdata: /var/lib/postgresql/data
Now add this one:
– /docker/odoo-config: /etc/odoo
In de odoo-config now place a file called odoo.conf:

[options]
proxy_mode = True

Hope this helps.
Stuart

Hello
Could I have a tutorial on configuring the addons?
I installed odoo on my Synology DS218 + with a RAM = 10 GB (With extension).
Is there a model odoo.conf file to adapt to put in the config directory?
After installation, I don’t see the odoo.conf file in the config directory. After installing a module (like sale), there is an odoo.cong file that appears in config, but read only. With a syntax (under ssh) in linux, I managed to make it writable. I put the path of the addons directory (/ volume1 / docker / odoo / addons) in tue odoo.config file.
By putting addons (like Odoo 14 HR Payroll) in the addons directory and updating, I do not see them appear in the list of applications.
Could you guide me as best as possible in the configuration of the addons?
Best regards

What would be the best way to commit a working and completely configured image to a new host?
Are there any useful tools for this particular action perhaps?

Hello Stuart,

i have some problems with installation…

i get following error:

KeyError: ‘ir.http’ – – –
return self.models[model_name]
File “/usr/lib/python3/dist-packages/odoo/modules/registry.py”, line 177, in __getitem__
ir_http = request.registry[‘ir.http’]
File “/usr/lib/python3/dist-packages/odoo/http.py”, line 1449, in dispatch
return self.app(environ, start_response)
File “/usr/lib/python3/dist-packages/werkzeug/wsgi.py”, line 766, in __call__
return self.app(environ, start_wrapped)
File “/usr/lib/python3/dist-packages/odoo/http.py”, line 1263, in __call__
return self.dispatch(environ, start_response)
File “/usr/lib/python3/dist-packages/odoo/http.py”, line 1295, in __call__
result = odoo.http.root(environ, start_response)
File “/usr/lib/python3/dist-packages/odoo/service/wsgi_server.py”, line 99, in application_unproxied
return application_unproxied(environ, start_response)
File “/usr/lib/python3/dist-packages/odoo/service/wsgi_server.py”, line 124, in application
return self.app(e, s)
File “/usr/lib/python3/dist-packages/odoo/service/server.py”, line 440, in app
application_iter = app(environ, start_response)
File “/usr/lib/python3/dist-packages/werkzeug/serving.py”, line 258, in execute
execute(self.server.app)
File “/usr/lib/python3/dist-packages/werkzeug/serving.py”, line 270, in run_wsgi
Traceback (most recent call last):

could you maybe help?

br, Muramez

Hi Tom,
I think that would be no problem. You can use the same image so you can start at step 4. This time name the container odoo2-postgres. If you want to persist your data, probably you want that, you create another file/folder named /docker/odoo2-pgdata. In Step 5, choose a different port, for example 8090 as the local port. The container port will stay the same (8089) because it’s the same thing we are starting. Now link container odoo2-postgres to the Alias: db. This means that the new Odoo will look at the odoo2 database. This shoul be it to be up and running with two instances of Odoo.

Hi, thanks for your input.
The Postgress server doesn’t work, it asks me to initialize the service, I don’t know where to start it from, could you help me.
Thank you very much

Have you thought of posting a docker compose for this? I’d had some issues with other compose files not loading properly, your steps actually helped me create my own compose file which works like a charm.

Thanks!

Thanks for excellent guide. It really helped me. I’ve got pretty far with this and now I’m to the point that I need to filter the database so only the default one is shown. For some reason I can’t open the /etc/odoo/odoo.conf file to add a database filter. I’m hoping to use the docker terminal app to quickly change it but I can’t figure it out. Any ideas? It’s likely that docker is very new to me. Any help is appreciated.

Hi stuart…
After follow your steps i managed to install odoo 14 on my synology. Many thanks to you.

But another issue i faced now, how do u setup smtp so that odoo can send out email?
Now it seems i cannot send out email

Thank you
Helmi

Hi Stuart,

Can i know how do u setup smtp for odoo docker to send email out email?
mine seems cannot send out email.

Thank you

Cannot connect to Odoo docker synology 14 after successfull installation

Symptom: Odoo docker container stop immediatly after first start
Consequence: cannot connect to :8069
Look at docker synology detail>journal. Log: The container cannot access to the postgres db port
Reason for failure: The synology firewall is too restrictive

– How to check it: Stop the firewall and restart the odoo container. You should the access to your :8069 odoo install website

– What should you change:
Go to the NAS synology firewall and add following rules:
1) In order to reach the odoo web page
Application: Docker odoo-app
IP source: your internal network at least or all if you want to access fron the internet
Action: accept
2) For the internal communication between the odoo app and the postgres DB
Port: 5432
IP source: all
Action: accept

Good luck, it work for me!

Hello Stuart,
Could I have a tutorial on configuring the addons?
I installed odoo on my Synology DS218 + with a RAM = 10 GB (With extension).
Is there a model odoo.conf file to adapt to put in the config directory?
After installation, I don’t see the odoo.conf file in the config directory. After installing a module (like sale), there is an odoo.cong file that appears in config, but read only. With a syntax (under ssh) in linux, I managed to make it writable. I put the path of the addons directory (/ volume1 / docker / odoo / addons) in tue odoo.config file.
By putting addons (like Odoo 14 HR Payroll) in the addons directory and updating, I do not see them appear in the list of applications.
Could you guide me as best as possible in the configuration of the addons?
Best regards

May a stupid question but I cannot find where to expose the port 8069 in my Synology docker. A hint would be great

Bedankt

Had the same problem. Maybe you made the same mistake as me. I forgot to set Local port to 8069 (i left the default value “any”).

I finally found the mistake I made, I forgot to set localport to 8069 (I left any). It works since the modification. So no need advices 😉

Hi, Great guide, all works well for a few months for me now.
I’m interested to upgrade to newer 14 release, what is the correct way to do it?

Hi Stuart
i have installed two containers and every thing is ok, but when i am trying to connect with static IP it doesn’t work.
please help me if you can

Leave a Reply

Your email address will not be published. Required fields are marked *