A complete, automated setup for Odoo 18 local development environment on Ubuntu/Debian systems.
# Clone this repository
git clone https://github.com/yourusername/odoo18-dev-setup.git
cd odoo18-dev-setup
# Make the setup script executable
chmod +x setup-odoo18.sh
# Run the setup script
./setup-odoo18.sh
The script will:
- Install all required system dependencies
- Set up PostgreSQL with your user account
- Clone Odoo 18 from the official repository
- Create a Python virtual environment
- Install Python dependencies
- Configure Odoo for development
- Create systemd service for easy management
- Set up a Makefile for simple commands
- Ubuntu 20.04+ or Debian 11+
- sudo privileges user
- Python 3 with development headers
- PostgreSQL database server
- Git and build tools
- Required libraries for Odoo (XML, image processing, etc.)
- Odoo 18 (latest from official repository)
- Python virtual environment with all dependencies
- PostgreSQL user matching your system user
- Systemd service for automatic startup
- Configuration files in your home directory
After installation, navigate to the Odoo directory and use the Makefile commands:
cd /opt/odoo
make start # Start Odoo as a system service
make stop # Stop Odoo service
make restart # Restart Odoo service
make status # Show service status
make logs # Show live logs (Ctrl+C to exit)
make dev # Start in development mode with auto-reload
make manual # Start manually with console output
make shell # Open Odoo shell for debugging
make test # Test if Odoo is responding
make clean # Stop all services including PostgreSQL
make install # Install/update Python dependencies
make help # Show all available commands
For active development:
make dev # Starts with auto-reload, file watching
For manual control with console output:
make manual # See all logs in terminal
For production-like testing:
make start # Runs as background service
Once started, access Odoo at: http://localhost:8069
- Master Password:
admin123
- Database: Create new or use existing
- Admin User: Set during database creation
/opt/odoo/
βββ odoo18/ # Odoo source code
βββ venv/ # Python virtual environment
βββ Makefile # Management commands
βββ setup-odoo18.sh # Setup script
~/.config/odoo/
βββ odoo.conf # Odoo configuration
~/.local/share/odoo/
βββ odoo.log # Log file
βββ addons/ # Custom addons directory
βββ filestore/ # File storage
Located at: ~/.config/odoo/odoo.conf
Key settings:
- Database connection settings
- Addons paths
- Log configuration
- Data directory
- Host: localhost
- Port: 5432
- User: Your system username
- Password: Set during installation
make dev
- Automatically reloads on Python file changes
- Reloads QWeb templates on change
- Enhanced debugging with Werkzeug
- Console output for immediate feedback
Place custom addons in:
/opt/odoo/odoo18/addons/
(for core development)~/.local/share/odoo/addons/18.0/
(for custom addons)
Update addons_path
in config if needed.
make status # Check what's running
sudo journalctl -u odoo -f # View detailed logs
make restart # Restart services
# Test PostgreSQL connection
psql -h localhost -U $USER -d postgres
# Reset database (if needed)
# This will delete all data!
sudo -u postgres dropdb your_database_name
# Fix ownership if needed
sudo chown -R $USER:$USER /opt/odoo
sudo chown -R $USER:$USER ~/.local/share/odoo
# Check what's using port 8069
ss -tlnp | grep 8069
# Kill any conflicting processes
sudo pkill -f odoo-bin
cd /opt/odoo/odoo18
git pull origin 18.0
cd ..
make install # Update dependencies if needed
make restart # Restart with new code
make install
To completely remove the installation:
# Stop services
make clean
# Remove systemd service
sudo systemctl disable odoo
sudo rm /etc/systemd/system/odoo.service
sudo systemctl daemon-reload
# Remove files
sudo rm -rf /opt/odoo
rm -rf ~/.config/odoo
rm -rf ~/.local/share/odoo
# Optionally remove PostgreSQL user
sudo -u postgres dropuser $USER
- The setup uses your system user instead of a dedicated
odoo
user for easier development - PostgreSQL remains running after
make stop
- usemake clean
to stop everything - Configuration files are in your home directory for easy access
- All data is stored in
~/.local/share/odoo/
Feel free to submit issues and pull requests to improve this setup script.
This setup script is provided under the MIT License. Odoo itself is licensed under LGPL v3.