Odoo ServerΒΆ

Create a systemd service unit file for the Odoo instance on Debian with these steps:

  1. Navigate to the systemd service directory:

    cd /etc/systemd/system/
    
  2. Create a new service unit file for the Odoo instance odoo-server.service:

    sudo nano odoo-server.service
    
  3. Add the following content:

    [Unit]
    Description=Odoo Server Instance
    After=network.target
    
    [Service]
    User=odoo
    Group=odoo
    WorkingDirectory=/usr/local/logistics/Odoo/Instances/Logistics_16_Develop/
    ExecStart=/usr/local/logistics/Python/venv/odoo_16/bin/python3 \
    /usr/local/logistics/Odoo/Instances/Logistics_16_Develop/odoo/odoo-bin \
    -c /usr/local/logistics/Odoo/Instances/Logistics_16_Develop/logistics_16_test.cfg
    Type=simple
    
    [Install]
    WantedBy=multi-user.target
    
  4. Reload systemd to load the new service unit:

    sudo systemctl daemon-reload
    
  5. Enable the service to start automatically on boot:

    sudo systemctl enable odoo-server
    
  6. Start the Odoo service:

    sudo systemctl start odoo-server
    

The Odoo Server should now be running as a systemd service. Manage it using systemctl commands like start, stop, restart, status, etc.