Professional Odoo installation script with domain configuration, official Nginx, SSL certificates, and dynamic configuration generation for Ubuntu 22.04
# Download the installer
wget https://raw.githubusercontent.com/mah007/OdooScript/refs/heads/16.0/odoo_installer.sh
# Make it executable
chmod +x odoo_installer.sh
# Run the installer
sudo ./odoo_installer.sh
- Features
- System Requirements
- Installation Process
- Technical Architecture
- Configuration Options
- SSL Certificate Management
- Nginx Configuration
- Troubleshooting
- Contributing
- License
- Interactive domain configuration with validation
- Automatic DNS verification and IP detection
- Support for both domain-based and IP-based installations
- Graceful fallback for DNS misconfigurations
- Latest Nginx version from official nginx.org repository (1.20.5+)
- Automatic removal of outdated Ubuntu stock versions
- Proper repository configuration with signing keys
- Modern SSL/TLS configuration with security headers
- Let's Encrypt: Automated certificate generation with Certbot
- Self-signed: Fallback certificates for testing environments
- Automatic certificate renewal setup
- Modern TLS 1.2/1.3 configuration
- Native Odoo configuration generation using
odoo-bin
- Clean configuration without forced master passwords
- Automatic proxy mode detection for Nginx setups
- Secure file permissions and ownership
- Comprehensive error handling with graceful degradation
- Detailed logging and audit trails
- Secure user and permission management
- Modern cryptographic standards
- Real-time progress tracking with visual indicators
- Multi-level logging (DEBUG, INFO, WARNING, ERROR)
- Installation validation and health checks
- Comprehensive installation reports
- Ubuntu 22.04 LTS (Jammy Jellyfish)
- Root or sudo privileges required
Component | Minimum | Recommended |
---|---|---|
RAM | 2GB | 4GB+ |
Storage | 10GB | 20GB+ |
CPU | 1 core | 2+ cores |
- Internet connection for package downloads
- Domain name (optional, IP fallback available)
- Open ports: 80 (HTTP), 443 (HTTPS), 8069 (Odoo direct)
The installer follows an 8-step automated process:
- System requirements validation
- Ubuntu version verification
- Disk space and memory checks
- Internet connectivity testing
- User and group creation (
odoo
user) - System package updates
- Locale configuration
- Basic tool installation
- PostgreSQL 16 installation from official repository
- Database user configuration
- Service enablement and startup
- Connection testing
- Python 3.11 packages and libraries
- System development tools
- Node.js and npm packages
- Odoo-specific dependencies
- PDF generation library installation
- Architecture detection (x64/x32)
- Version verification
- Integration testing
- Source code download from official repository
- Python requirements installation
- Directory structure creation
- Permission configuration
- Systemd service file creation
- Nginx installation and configuration
- SSL certificate generation/installation
- Service enablement
- Installation validation
- Service health checks
- Report generation
- Success confirmation
Enhanced Odoo Installer
βββ Configuration Management
β βββ Domain validation and DNS checking
β βββ SSL certificate type selection
β βββ Dynamic Odoo configuration generation
βββ Package Management
β βββ Official repository integration
β βββ Dependency resolution
β βββ Version compatibility checking
βββ Service Management
β βββ Systemd service configuration
β βββ Process monitoring
β βββ Automatic startup configuration
βββ Security Framework
βββ User privilege management
βββ File permission enforcement
βββ SSL/TLS implementation
odoo_installer.sh
βββ Global Variables & Configuration
βββ Utility Functions
β βββ Logging system
β βββ Progress tracking
β βββ Error handling
β βββ User interaction
βββ Validation Functions
β βββ System requirements
β βββ Network connectivity
β βββ Version compatibility
βββ Installation Functions
β βββ step_preflight_checks()
β βββ step_system_preparation()
β βββ step_database_setup()
β βββ step_dependencies_installation()
β βββ step_wkhtmltopdf_installation()
β βββ step_odoo_installation()
β βββ step_service_configuration()
β βββ step_final_setup()
βββ Nginx & SSL Functions
β βββ install_official_nginx()
β βββ generate_self_signed_ssl()
β βββ install_letsencrypt_ssl()
β βββ create_nginx_odoo_config()
βββ Main Execution Flow
- Odoo 14.0 (LTS)
- Odoo 15.0
- Odoo 16.0
- Odoo 17.0
- Odoo 18.0 (Latest)
# User provides domain name
Domain: odoo.example.com
SSL: Let's Encrypt (automatic)
Access: https://odoo.example.com
# No domain provided
Domain: Server IP address
SSL: Self-signed certificate
Access: https://[server-ip]
[options]
; Basic Odoo configuration
db_host = localhost
db_port = 5432
db_user = odoo
db_password = False
addons_path = /odoo/odoo/addons
logfile = /var/log/odoo/odoo-server.log
log_level = info
; Proxy mode configuration (when Nginx is installed)
proxy_mode = True
[Unit]
Description=Odoo
Documentation=http://www.odoo.com
Requires=postgresql.service
After=postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/odoo/odoo/odoo-bin -c /etc/odoo/odoo.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
The installer uses Certbot via snapd for Let's Encrypt certificates:
# Automatic installation process
1. Install snapd (if not present)
2. Install certbot via snap
3. Create temporary Nginx configuration
4. Obtain SSL certificate
5. Configure automatic renewal
6. Update Nginx configuration
# Test renewal (dry run)
certbot renew --dry-run
# Manual renewal
certbot renew
# Automatic renewal (configured by installer)
systemctl status snap.certbot.renew.timer
For testing or internal use:
# Certificate generation
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout /etc/ssl/nginx/server.key \
-out /etc/ssl/nginx/server.crt \
-subj "/C=US/ST=State/L=City/O=Organization/OU=OrgUnit/CN=$DOMAIN_NAME"
The installer creates a production-ready Nginx configuration:
# Upstream configuration
upstream odoo {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}
# HTTP to HTTPS redirect
server {
listen 80;
server_name example.com;
rewrite ^(.*) https://$host$1 permanent;
}
# HTTPS server block
server {
listen 443 ssl;
server_name example.com;
# SSL configuration
ssl_certificate /path/to/certificate;
ssl_certificate_key /path/to/private/key;
ssl_protocols TLSv1.2 TLSv1.3;
# Proxy configuration
location / {
proxy_pass http://odoo;
proxy_set_header X-Forwarded-Host $http_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;
}
# WebSocket support
location /websocket {
proxy_pass http://odoochat;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
# Security enhancements
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
proxy_cookie_flags session_id samesite=lax secure;
# Check DNS configuration
dig +short your-domain.com
# Verify server IP
curl -s ifconfig.me
# Test domain resolution
nslookup your-domain.com
# Check Odoo service
systemctl status odoo
journalctl -u odoo -f
# Check PostgreSQL
systemctl status postgresql
sudo -u postgres psql -l
# Check Nginx (if installed)
systemctl status nginx
nginx -t
# Installation logs
/tmp/odoo_install_YYYYMMDD_HHMMSS.log
# Odoo application logs
/var/log/odoo/odoo-server.log
# Nginx logs (if installed)
/var/log/nginx/odoo.access.log
/var/log/nginx/odoo.error.log
# System logs
journalctl -u odoo
journalctl -u nginx
Service | Port | Protocol | Purpose |
---|---|---|---|
Odoo | 8069 | HTTP | Web interface |
Odoo | 8072 | HTTP | WebSocket/Chat |
Nginx | 80 | HTTP | HTTP redirect |
Nginx | 443 | HTTPS | Secure web access |
PostgreSQL | 5432 | TCP | Database |
# Odoo directories
/odoo/odoo/ - odoo:odoo (755)
/etc/odoo/ - odoo:odoo (755)
/var/log/odoo/ - odoo:odoo (755)
# Configuration files
/etc/odoo/odoo.conf - odoo:odoo (640)
# SSL certificates
/etc/ssl/nginx/ - root:root (644/600)
# Test Odoo web interface
curl -I http://localhost:8069
# Test with Nginx (if installed)
curl -I https://your-domain.com
# Check database connectivity
sudo -u odoo psql -h localhost -p 5432 -U odoo -l
# Check certificate details
openssl x509 -in /path/to/certificate -text -noout
# Test SSL connection
openssl s_client -connect your-domain.com:443 -servername your-domain.com
-- /etc/postgresql/16/main/postgresql.conf
shared_buffers = 256MB
effective_cache_size = 1GB
maintenance_work_mem = 64MB
checkpoint_completion_target = 0.9
wal_buffers = 16MB
default_statistics_target = 100
# /etc/nginx/nginx.conf
worker_processes auto;
worker_connections 1024;
keepalive_timeout 65;
client_max_body_size 100M;
# /etc/odoo/odoo.conf
workers = 4
max_cron_threads = 2
limit_memory_hard = 2684354560
limit_memory_soft = 2147483648
limit_request = 8192
limit_time_cpu = 600
limit_time_real = 1200
# Create database backup
sudo -u odoo pg_dump -h localhost -p 5432 -U odoo database_name > backup.sql
# Restore database
sudo -u odoo psql -h localhost -p 5432 -U odoo -d database_name < backup.sql
# Backup Odoo files
tar -czf odoo_backup.tar.gz /odoo/odoo /etc/odoo /var/log/odoo
# Backup SSL certificates
tar -czf ssl_backup.tar.gz /etc/ssl/nginx /etc/letsencrypt
# Update Odoo to newer version
cd /odoo/odoo
git fetch origin
git checkout 17.0 # or desired version
sudo systemctl restart odoo
# Update system packages
sudo apt update && sudo apt upgrade
# Update SSL certificates
sudo certbot renew
We welcome contributions to improve the Enhanced Odoo Installer! Here's how you can help:
# Clone the repository
git clone https://github.com/mah007/OdooScript.git
cd OdooScript
# Create a feature branch
git checkout -b feature/your-feature-name
# Make your changes and test
./odoo_installer.sh
# Commit and push
git commit -m "Add your feature description"
git push origin feature/your-feature-name
- Test on clean Ubuntu 22.04 installations
- Verify both domain and IP-based installations
- Test SSL certificate generation (both Let's Encrypt and self-signed)
- Validate all Odoo versions (14.0-18.0)
- Check error handling and recovery scenarios
- Use consistent bash scripting practices
- Add comments for complex logic
- Follow the existing function naming convention
- Include proper error handling
- Update documentation for new features
This project is licensed under the MIT License - see the LICENSE file for details.
- Odoo for the amazing ERP platform
- Nginx for the high-performance web server
- Let's Encrypt for free SSL certificates
- PostgreSQL for the robust database system
- The open-source community for continuous inspiration
- Documentation: GitHub Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with β€οΈ for the Odoo community By Mahmoud Abdel Latif
Website β’ Documentation β’ Issues
Odoo dependence installation script for Ubuntu 14.04 , 15.04 ,16.04 ,20.04 , 22.04 ,*24.04(universal)
make your envirument ready for all kind of odoo with pycharm IDE
after run the script u have to download odoo manully
ssh-keygen -t ed25519 -C "your_email@example.com"
./odoo-bin -w a -s -c ../odoo.conf --stop-after-init
./odoo-bin -w a -s -c /etc/odoo/odoo.conf --stop-after-init
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo dpkg-reconfigure locales
########################################################################
adduser odoo
########################################################################
apt-get update
apt-get install software-properties-common
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install python-certbot-apache
sudo certbot --apache
#######################################################################
wget https://raw.githubusercontent.com/mah007/OdooScript/12.0/nginx.sh
bash nginx.sh
apt-get update
apt-get install software-properties-common -y
add-apt-repository universe
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install certbot python-certbot-nginx -y
sudo certbot --nginx
#######################################################################
nano /etc/apt/sources.list.d/pgdg.list
deb deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
########################################################################
sudo su - postgres -c "createuser -s odoo" 2> /dev/null || true
wget https://raw.githubusercontent.com/mah007/OdooScript/master/odoo_pro.sh
sudo /bin/sh odoo_pro.sh
wget http://software.virtualmin.com/gpl/scripts/install.sh
sh /root/install.sh -b LEMP
PG UTF*
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8'
lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';