Install Odoo from docker


Pava

Recommended Posts

  • 4 months later...

Just open the console (ssh in or use from the GUI the >_ button in the top) and run this:

 

docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name db postgres:13

 

This will install your database and set the username and password. Save the master password here.

 

Then run:

 

docker run -v odoo-data:/var/lib/odoo -d -p 8069:8069 --name odoo --link db:db -t odoo

 

 

This will create the instance with persistent storage. 

 

Then connect to you servers ip with port 8069.   Something like 192.168.1.22:8069   This will get you to the first login page where you create the database and have the option to load demo data to play around with. 

 

Used the sauce from : https://registry.hub.docker.com/_/odoo/

 

Not I would advice to look into backups of the database, just in case. :)  Here is a good walkthrough. 

 

 

 

 

 

 

 

Link to comment
  • 6 months later...
  • 4 months later...

I cannot get this working for the life of me. Every time I save the docker template and check the logs, I get:

grep: /etc/odoo/odoo.conf: No such file or directory

 

When I attempt to open the webui, I see this in the logs:

2023-03-20 20:04:50,346 1 ERROR ? odoo.modules.loading: Database odoo not initialized, you can force it with `-i base` 
2023-03-20 20:04:50,347 1 INFO ? odoo.modules.registry: Registry loaded in 0.178s 
2023-03-20 20:04:50,350 1 ERROR odoo odoo.http: Exception during request handling. 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1584, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 134, in retrying
    result = func()
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1598, in _serve_ir_http
    ir_http = self.registry['ir.http']
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 190, in __getitem__
    return self.models[model_name]
KeyError: 'ir.http'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1990, in __call__
    response = request._serve_db()
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1590, in _serve_db
    exc.error_response = self.registry['ir.http']._handle_error(exc)
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 190, in __getitem__
    return self.models[model_name]
KeyError: 'ir.http'
2023-03-20 20:04:50,356 1 INFO odoo werkzeug: 192.168.89.249 - - [20/Mar/2023 20:04:50] "GET / HTTP/1.1" 500 - 8 0.195 0.086
2023-03-20 20:04:50,604 1 ERROR odoo odoo.http: Exception during request handling. 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1584, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 134, in retrying
    result = func()
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1598, in _serve_ir_http
    ir_http = self.registry['ir.http']
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 190, in __getitem__
    return self.models[model_name]
KeyError: 'ir.http'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1990, in __call__
    response = request._serve_db()
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1590, in _serve_db
    exc.error_response = self.registry['ir.http']._handle_error(exc)
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 190, in __getitem__
    return self.models[model_name]
KeyError: 'ir.http'
2023-03-20 20:04:50,605 1 INFO odoo werkzeug: 192.168.89.249 - - [20/Mar/2023 20:04:50] "GET /favicon.ico HTTP/1.1" 500 - 2 0.012 0.037
2023-03-20 20:04:56,372 1 ERROR odoo odoo.sql_db: bad query: 
            SELECT latest_version
            FROM ir_module_module
             WHERE name='base'
        
ERROR: relation "ir_module_module" does not exist
LINE 3:             FROM ir_module_module
                         ^
 
2023-03-20 20:04:56,373 1 WARNING odoo odoo.addons.base.models.ir_cron: Tried to poll an undefined table on database odoo. 
2023-03-20 20:04:58,377 1 ERROR odoo odoo.sql_db: bad query: 
            SELECT latest_version
            FROM ir_module_module
             WHERE name='base'
        
ERROR: relation "ir_module_module" does not exist
LINE 3:             FROM ir_module_module
                         ^
 
2023-03-20 20:04:58,378 1 WARNING odoo odoo.addons.base.models.ir_cron: Tried to poll an undefined table on database odoo. 

 

I created a config file in the appdata folder (which is set in the docker template as /etc/odoo) and I still have the same problem.

 

Would you mind sharing some screenshots of the setup that you were able to get working? 

  • Upvote 1
Link to comment

I don't know if this "the right way", but I got to the odoo webUI doing the following. Hopefully it is helpful to you or someone else, and it's here for me when I need it later ^^;

 

Reference per @Thomasg - "Used the sauce from : https://registry.hub.docker.com/_/odoo/"

 

 

Firstly, install PostgreSQL 15 via your unRAID Apps and set as follows...

 

Name  - db    <---- per the reference "The alias of the container running Postgres must be db for Odoo to be able to connect to the Postgres server."

POSTGRES_PASSWORD: Set a password you think is strong, I used a 16 chars alphanumeric from a rnd generator
POSTGRES_USER: odoo
POSTGRES_DB: postgres

 

Next, install the Odoo15 from your unRAID Apps and set as follows...

 

Addons: /mnt/cache/appdata/odoo/extra-addons  <--changed these to /mnt/cache/appdata/   to hopefully keep it all in an easy to find/use space.
Configuration: /mnt/cache/appdata/odoo/config  <--changed these to /mnt/cache/appdata/    to hopefully keep it all in an easy to find/use space.
DB Username: odoo
Database Password: Previously entered strong password from above
Database URL: your unRAID server IP

 

And that seems to have worked for me. Hope it helps o/

Link to comment
  • 2 months later...
On 3/28/2023 at 3:12 AM, ryoko227 said:

I don't know if this "the right way", but I got to the odoo webUI doing the following. Hopefully it is helpful to you or someone else, and it's here for me when I need it later ^^;

 

Reference per @Thomasg - "Used the sauce from : https://registry.hub.docker.com/_/odoo/"

 

 

Firstly, install PostgreSQL 15 via your unRAID Apps and set as follows...

 

Name  - db    <---- per the reference "The alias of the container running Postgres must be db for Odoo to be able to connect to the Postgres server."

POSTGRES_PASSWORD: Set a password you think is strong, I used a 16 chars alphanumeric from a rnd generator
POSTGRES_USER: odoo
POSTGRES_DB: postgres

 

Next, install the Odoo15 from your unRAID Apps and set as follows...

 

Addons: /mnt/cache/appdata/odoo/extra-addons  <--changed these to /mnt/cache/appdata/   to hopefully keep it all in an easy to find/use space.
Configuration: /mnt/cache/appdata/odoo/config  <--changed these to /mnt/cache/appdata/    to hopefully keep it all in an easy to find/use space.
DB Username: odoo
Database Password: Previously entered strong password from above
Database URL: your unRAID server IP

 

And that seems to have worked for me. Hope it helps o/

 

For the life of me I just do not understand what I am doing wrong. I followed all steps but no GUI logs say "grep: /etc/odoo/odoo.conf: No such file or directory"

 

Im I supposed to somehting additional from "Reference per @Thomasg - "Used the sauce from : https://registry.hub.docker.com/_/odoo/"

 

Please any help would really be welcomed I am really really lost in the weeds here.

 

Thanks,

 

Vic

Link to comment

I also tried with odoo and it's probably the hardest app to selfhost that i ever tried. I once managed to let it work, but then after an upgrade it broke and i never managed to let it work again. I wonder if it's intentional to let people to subscribe to the cloud service (which is completely unaffordable for small business like me)

Link to comment
4 hours ago, PixelPrint said:

I also tried with odoo and it's probably the hardest app to selfhost that i ever tried. I once managed to let it work, but then after an upgrade it broke and i never managed to let it work again. I wonder if it's intentional to let people to subscribe to the cloud service (which is completely unaffordable for small business like me)

It is so so fustrating becuase it is such an amazing software. I hope someone comes up on this thread that can walk us through it.

Link to comment
  • 2 months later...
On 6/12/2023 at 1:35 PM, wipzcream said:

Dear All

 

Any one know How to config Swag reverse proxy with Odoo 15. I want to access from outside 

 

Best Regards

 

Hi, have you managed to get it working with Swag? I have it to odoo.mydomain.com, I get the login screen, but after I login I get a white screen with nothing on it.

Link to comment
On 9/15/2023 at 9:33 PM, carotna said:

 

Hi, have you managed to get it working with Swag? I have it to odoo.mydomain.com, I get the login screen, but after I login I get a white screen with nothing on it.

Is the login in the center or off to the left without images.  I got it up and running with the CA image.  But then it stopped responding correctly.  Login came up, left justified in screen, then just a white screen.  Little digging found this may happen due to non-persistent storage (storage within the container, instead of to a share) when an app/component in Odoo restarts. I know the template on CA has storage locations, but the docker for me never put any data there.  

 

I used the above commands in root terminal and have a new instance up and running.  Waiting to see if it is stable.  I am not a professional just have a bit of ability so shot in the dark.

Link to comment
  • 1 month later...

What finally worked for me.

 

Installed postgresql:15 through apps.

 

configured the Postgresql

password=odoouser

user=odoo

DB=db

 

set Datastorage path to be "/mnt/cache/appdata/postgresql/"

 

 

Used the docker compose plugin. Add New stack - Advanced - set the location to /mnt/user/appdata/odoo

Edit Stack - Compose file

 

version: '2'
services:
  odoo:
    image: odoo:16.0
    user: root
    ports:
      - "8069:8069"
      - "8072:8072"
    tty: true
    command: --
    volumes:
      - /mnt/user/appdata/odoo/data:/var/lib/odoo:rw
      - /mnt/user/appdata/odoo/config:/etc/odoo:rw
      - /mnt/user/appdata/odoo/addons:/mnt/extra-addons:rw
    environment:
     - HOST=[Server IP address for postgresql here]
     - PORT=5432
     - USER=odoo
     - PASSWORD=odoouser

 

 

 

 

That got it to install correctly .

 

I did at this point change the /mnt/user/appdata/odoo folder owner to root - I am not sure if this was needed

 

However......

 

 

 

then goto /mnt/user/appdata/odoo/config

 

edit odoo.conf

 

add the lines

 

addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo

 

 

Restart Odoo and you should see a Filestore folder created inside the data directory which should give persistent data working nicely. I moved an existing database onto this system from a bare metal setup and so far all seems good  

 

 

The three things on a lot of attempted setups that I missed were:-

 

Getting the volume mappings correct - never used Docker before - I am wondering for speed whether the Data store should be mapped to "cache" opposed to "user". 

 

not having user:root  - it would not install before that

 

editing the odoo.conf file to give the mappings within odoo

 


 

 

 

 

 

 

 

 

 

 

 

 

 

 

Edited by georgebrooksmso
Link to comment
  • 1 month later...

For anyone looking for answers I followed exactly what georgebrooksmso posted above HOWEVER I used "image: odoo:17.0" after struggling with V15 from CA. I could never get V15 from CA to work with NGINX reverse proxy, V17.0 works fine with the proxy conf below (odoo.subdomain.conf)

 

server {
    listen 80;
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name odoo.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;


    location / {

		include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_odoo [IPADDRESSOFYOURSERVER];
        proxy_pass http://$upstream_odoo:8069;
	
	}

    location ~* /web/static/ {
        #proxy_cache_valid 200 60m;
        #proxy_buffering on;
        #expires 864000;
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_odoo [IPADDRESSOFYOURSERVER];
        proxy_pass http://$upstream_odoo:8069;
    }
}

 

I have not and likely will not look into the conversion of a V15 database to V16/17. I'll likely re-enter my data.

If you want to test V17 without risking your current data I recommend changing your "Database Storage Path" in the postgresql:15 image to something different (e.g. I changed mine from /mnt/cache/appdata/postgresql15 to /mnt/cache/appdata/postgresql15test). This will create a new folder without destroying your old data and let you create and test a new DB, then you can switch back to the original path to work on a conversion.

Link to comment
  • 4 weeks later...
On 3/28/2023 at 3:12 PM, ryoko227 said:

I don't know if this "the right way", but I got to the odoo webUI doing the following. Hopefully it is helpful to you or someone else, and it's here for me when I need it later ^^;

 

Reference per @Thomasg - "Used the sauce from : https://registry.hub.docker.com/_/odoo/"

 

 

Firstly, install PostgreSQL 15 via your unRAID Apps and set as follows...

 

Name  - db    <---- per the reference "The alias of the container running Postgres must be db for Odoo to be able to connect to the Postgres server."

POSTGRES_PASSWORD: Set a password you think is strong, I used a 16 chars alphanumeric from a rnd generator
POSTGRES_USER: odoo
POSTGRES_DB: postgres

 

Next, install the Odoo15 from your unRAID Apps and set as follows...

 

Addons: /mnt/cache/appdata/odoo/extra-addons  <--changed these to /mnt/cache/appdata/   to hopefully keep it all in an easy to find/use space.
Configuration: /mnt/cache/appdata/odoo/config  <--changed these to /mnt/cache/appdata/    to hopefully keep it all in an easy to find/use space.
DB Username: odoo
Database Password: Previously entered strong password from above
Database URL: your unRAID server IP

 

And that seems to have worked for me. Hope it helps o/

thank you very much. This works... UPVOTE the man ^^^^^^^^^^^^^^^^

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.