Introduction
This guide provides step-by-step instructions for installing Odoo 18 on Linux, Windows, and macOS, plus deployment options like Docker and Odoo.sh.
System Requirements
- CPU: 2+ cores recommended
- RAM: Minimum 4GB, 8GB+ recommended
- Storage: 20GB+ free space
- Database: PostgreSQL 12+
Linux Installation (Ubuntu/Debian)
-
Update your system:
sudo apt update sudo apt upgrade -y
-
Install PostgreSQL:
sudo apt install postgresql -y
-
Install dependencies:
sudo apt install git python3-pip build-essential python3-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libssl-dev -y
-
Install wkhtmltopdf:
sudo apt install wkhtmltopdf -y
-
Create PostgreSQL user:
sudo -u postgres createuser -s odoo
-
Download Odoo:
mkdir ~/odoo cd ~/odoo git clone https://github.com/odoo/odoo.git --depth 1 --branch 18.0 --single-branch .
-
Install Python dependencies:
cd ~/odoo pip3 install -r requirements.txt
-
Create Odoo configuration file:
sudo mkdir /etc/odoo sudo cp ~/odoo/debian/odoo.conf /etc/odoo/ sudo chown -R $USER:$USER /etc/odoo/
-
Edit the configuration file:
nano /etc/odoo/odoo.conf
Add/update these lines:
[options] admin_passwd = YourStrongPassword db_host = localhost db_port = 5432 db_user = odoo db_password = false addons_path = ~/odoo/addons logfile = /var/log/odoo/odoo-server.log
-
Create log directory:
sudo mkdir /var/log/odoo sudo chown -R $USER:$USER /var/log/odoo/
-
Launch Odoo:
cd ~/odoo python3 odoo-bin -c /etc/odoo/odoo.conf
Now access Odoo at http://localhost:8069
Windows Installation
-
Download installer:
Visit Odoo's download page and download the Windows installer for version 18.
-
Run the installer:
- Double-click the downloaded .exe file
- Follow the wizard prompts
- Choose installation options (PostgreSQL will be automatically installed)
- Create a Master Password when prompted
-
Complete installation:
After installation completes, Odoo will start automatically.
Access Odoo at http://localhost:8069
macOS Installation
-
Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Install dependencies:
brew install git python postgresql node npm wkhtmltopdf
-
Start PostgreSQL:
brew services start postgresql
-
Create PostgreSQL user:
createuser -s odoo
-
Clone Odoo:
mkdir ~/odoo cd ~/odoo git clone https://github.com/odoo/odoo.git --depth 1 --branch 18.0 --single-branch .
-
Install Python dependencies:
cd ~/odoo pip3 install -r requirements.txt
-
Create config file:
mkdir -p ~/Library/Application\ Support/Odoo cat > ~/Library/Application\ Support/Odoo/odoo.conf << EOF [options] admin_passwd = YourStrongPassword db_host = localhost db_port = 5432 db_user = odoo db_password = false addons_path = ~/odoo/addons EOF
-
Run Odoo:
cd ~/odoo python3 odoo-bin -c ~/Library/Application\ Support/Odoo/odoo.conf
Access Odoo at http://localhost:8069
Docker Installation
-
Install Docker:
Follow Docker's installation guide for your platform.
-
Create docker-compose.yml:
version: '3' services: web: image: odoo:18.0 depends_on: - db ports: - "8069:8069" volumes: - odoo-web-data:/var/lib/odoo - ./config:/etc/odoo - ./addons:/mnt/extra-addons environment: - HOST=db - USER=odoo - PASSWORD=odoo db: image: postgres:13 environment: - POSTGRES_DB=postgres - POSTGRES_PASSWORD=odoo - POSTGRES_USER=odoo volumes: - odoo-db-data:/var/lib/postgresql/data volumes: odoo-web-data: odoo-db-data:
-
Create folders:
mkdir -p ./config ./addons
-
Create configuration file:
cat > ./config/odoo.conf << EOF [options] admin_passwd = YourStrongPassword db_host = db db_port = 5432 db_user = odoo db_password = odoo addons_path = /mnt/extra-addons EOF
-
Start Odoo:
docker-compose up -d
Access Odoo at http://localhost:8069
Odoo.sh Cloud Deployment
-
Create an Odoo.sh account:
Sign up at www.odoo.sh.
-
Connect your GitHub account:
Follow the prompts to connect your GitHub account.
-
Create a new project:
- Click "New Project"
- Select GitHub repository (fork the official repo or use your own)
- Choose Odoo version 18.0
- Select your project plan (Free, Standard, or Professional)
-
Wait for deployment:
Odoo.sh will automatically build and deploy your instance.
-
Access your project:
Once deployed, you'll receive an email with your Odoo URL.
Setting Up Nginx as Reverse Proxy
-
Install Nginx:
sudo apt update sudo apt install nginx -y
-
Create Odoo Nginx configuration:
sudo nano /etc/nginx/sites-available/odoo
Add the following configuration:
upstream odoo { server 127.0.0.1:8069; } upstream odoochat { server 127.0.0.1:8072; } server { listen 80; server_name your-domain.com; # Redirect to HTTPS return 301 https://$host$request_uri; } server { listen 443 ssl; server_name your-domain.com; # SSL configuration ssl_certificate /etc/ssl/your-domain.com.crt; ssl_certificate_key /etc/ssl/your-domain.com.key; ssl_session_timeout 30m; ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; # Log files access_log /var/log/nginx/odoo.access.log; error_log /var/log/nginx/odoo.error.log; # Increase proxy buffer sizes for handling large headers proxy_buffers 16 64k; proxy_buffer_size 128k; # Cache static files location ~* /web/static/ { proxy_cache_valid 200 90m; proxy_buffering on; expires 864000; proxy_pass http://odoo; } # Common gzip gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript; gzip on; # Websocket support for Odoo chat location /websocket { proxy_pass http://odoochat; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; } # Handle longpolling requests location /longpolling { proxy_pass http://odoochat; proxy_http_version 1.1; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; } # Main Odoo proxy location / { proxy_pass http://odoo; proxy_http_version 1.1; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; } # Restrict access to security-sensitive endpoints location ~* ^/web/database/manager { auth_basic "Restricted"; auth_basic_user_file /etc/nginx/odoo_passwd; proxy_pass http://odoo; } # Prevent access to Odoo database backups location ~* \.(sql|dump|gz|zip)$ { return 403; } }
-
Create basic authentication file (optional):
sudo apt install apache2-utils sudo htpasswd -c /etc/nginx/odoo_passwd admin
-
Enable site and restart Nginx:
sudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl restart nginx
-
Update Odoo configuration for proxy:
sudo nano /etc/odoo/odoo.conf
Add these lines:
proxy_mode = True longpolling_port = 8072
-
Set up SSL certificate:
sudo apt install certbot python3-certbot-nginx sudo certbot --nginx -d your-domain.com
-
Create systemd service for auto-start:
sudo nano /etc/systemd/system/odoo.service
Add this configuration:
[Unit] Description=Odoo Requires=postgresql.service After=network.target postgresql.service [Service] Type=simple User=odoo Group=odoo ExecStart=/usr/bin/python3 /home/username/odoo/odoo-bin -c /etc/odoo/odoo.conf StandardOutput=journal+console [Install] WantedBy=multi-user.target
-
Start and enable Odoo service:
sudo systemctl daemon-reload sudo systemctl start odoo sudo systemctl enable odoo
Your Odoo installation is now accessible via HTTPS at your domain name with Nginx handling proxying, security, SSL, and load balancing.
Post-Installation
-
Set up your first database:
- Access Odoo at http://localhost:8069
- Fill in database name, email, and password
- Select language and country
- Click "Create Database"
-
Install modules:
- Navigate to Apps
- Search for desired modules
- Click Install on needed modules
-
For production:
- Set up HTTPS with a valid SSL certificate
- Configure automatic backups
- Set up a reverse proxy (Nginx recommended)
- Create systemd service for auto-start (on Linux)
Troubleshooting
- Database connection issues: Verify PostgreSQL is running and credentials are correct
- Missing dependencies: Check logs for missing Python packages or system dependencies
- Port conflicts: Change default port in odoo.conf if 8069 is already in use
- Performance issues: Check server resources; increase RAM or CPU as needed
- Nginx errors: Check syntax with
nginx -t
and examine error logs at/var/log/nginx/error.log
Need help with your Odoo 18 installation? Contact our technical team for expert assistance!