{"id":16105539,"url":"https://github.com/mah007/odooscript","last_synced_at":"2025-10-04T06:23:26.745Z","repository":{"id":55071340,"uuid":"81379657","full_name":"mah007/OdooScript","owner":"mah007","description":"Odoo 10 11 12,13 installation script for Ubuntu 14.04 , 15.04 ,16.04,18.04 (universal)  ","archived":false,"fork":false,"pushed_at":"2025-01-10T14:39:05.000Z","size":267,"stargazers_count":50,"open_issues_count":7,"forks_count":89,"subscribers_count":11,"default_branch":"16.0","last_synced_at":"2025-03-29T20:05:58.674Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.mah007.com","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mah007.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-08T21:50:23.000Z","updated_at":"2025-01-10T14:39:09.000Z","dependencies_parsed_at":"2024-01-20T15:26:12.124Z","dependency_job_id":"2c783b13-8fd2-430f-9612-1d9abf3b6f11","html_url":"https://github.com/mah007/OdooScript","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mah007%2FOdooScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mah007%2FOdooScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mah007%2FOdooScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mah007%2FOdooScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mah007","download_url":"https://codeload.github.com/mah007/OdooScript/tar.gz/refs/heads/16.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399877,"owners_count":20932876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T19:09:55.026Z","updated_at":"2025-10-04T06:23:26.738Z","avatar_url":"https://github.com/mah007.png","language":"Shell","readme":"# Enhanced Odoo Installer\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Ubuntu](https://img.shields.io/badge/Ubuntu-22.04%20LTS-orange.svg)](https://ubuntu.com/)\n[![Odoo](https://img.shields.io/badge/Odoo-14.0%20to%2018.0-purple.svg)](https://www.odoo.com/)\n[![Nginx](https://img.shields.io/badge/Nginx-Latest-green.svg)](https://nginx.org/)\n[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-16-blue.svg)](https://www.postgresql.org/)\n\n\u003e **Professional Odoo installation script with domain configuration, official Nginx, SSL certificates, and dynamic configuration generation for Ubuntu 22.04**\n\n## 🚀 Quick Start\n\n```bash\n# Download the installer\nwget https://raw.githubusercontent.com/mah007/OdooScript/refs/heads/16.0/odoo_installer.sh\n# Make it executable\nchmod +x odoo_installer.sh\n\n# Run the installer\nsudo ./odoo_installer.sh\n```\n\n## 📋 Table of Contents\n\n- [Features](#-features)\n- [System Requirements](#-system-requirements)\n- [Installation Process](#-installation-process)\n- [Technical Architecture](#-technical-architecture)\n- [Configuration Options](#-configuration-options)\n- [SSL Certificate Management](#-ssl-certificate-management)\n- [Nginx Configuration](#-nginx-configuration)\n- [Troubleshooting](#-troubleshooting)\n- [Contributing](#-contributing)\n- [License](#-license)\n\n## ✨ Features\n\n### 🌐 **Domain \u0026 DNS Management**\n- Interactive domain configuration with validation\n- Automatic DNS verification and IP detection\n- Support for both domain-based and IP-based installations\n- Graceful fallback for DNS misconfigurations\n\n### 🔧 **Official Nginx Installation**\n- Latest Nginx version from official nginx.org repository (1.20.5+)\n- Automatic removal of outdated Ubuntu stock versions\n- Proper repository configuration with signing keys\n- Modern SSL/TLS configuration with security headers\n\n### 🔒 **SSL Certificate Automation**\n- **Let's Encrypt**: Automated certificate generation with Certbot\n- **Self-signed**: Fallback certificates for testing environments\n- Automatic certificate renewal setup\n- Modern TLS 1.2/1.3 configuration\n\n### ⚙️ **Dynamic Configuration**\n- Native Odoo configuration generation using `odoo-bin`\n- Clean configuration without forced master passwords\n- Automatic proxy mode detection for Nginx setups\n- Secure file permissions and ownership\n\n### 🛡️ **Enterprise-Grade Security**\n- Comprehensive error handling with graceful degradation\n- Detailed logging and audit trails\n- Secure user and permission management\n- Modern cryptographic standards\n\n### 📊 **Advanced Monitoring**\n- Real-time progress tracking with visual indicators\n- Multi-level logging (DEBUG, INFO, WARNING, ERROR)\n- Installation validation and health checks\n- Comprehensive installation reports\n\n## 🖥️ System Requirements\n\n### **Operating System**\n- Ubuntu 22.04 LTS (Jammy Jellyfish)\n- Root or sudo privileges required\n\n### **Hardware Requirements**\n| Component | Minimum | Recommended |\n|-----------|---------|-------------|\n| RAM | 2GB | 4GB+ |\n| Storage | 10GB | 20GB+ |\n| CPU | 1 core | 2+ cores |\n\n### **Network Requirements**\n- Internet connection for package downloads\n- Domain name (optional, IP fallback available)\n- Open ports: 80 (HTTP), 443 (HTTPS), 8069 (Odoo direct)\n\n## 🔄 Installation Process\n\nThe installer follows an 8-step automated process:\n\n### **Step 1: Pre-flight Checks**\n- System requirements validation\n- Ubuntu version verification\n- Disk space and memory checks\n- Internet connectivity testing\n\n### **Step 2: System Preparation**\n- User and group creation (`odoo` user)\n- System package updates\n- Locale configuration\n- Basic tool installation\n\n### **Step 3: Database Setup**\n- PostgreSQL 16 installation from official repository\n- Database user configuration\n- Service enablement and startup\n- Connection testing\n\n### **Step 4: Dependencies Installation**\n- Python 3.11 packages and libraries\n- System development tools\n- Node.js and npm packages\n- Odoo-specific dependencies\n\n### **Step 5: Wkhtmltopdf Installation**\n- PDF generation library installation\n- Architecture detection (x64/x32)\n- Version verification\n- Integration testing\n\n### **Step 6: Odoo Installation**\n- Source code download from official repository\n- Python requirements installation\n- Directory structure creation\n- Permission configuration\n\n### **Step 7: Service Configuration**\n- Systemd service file creation\n- Nginx installation and configuration\n- SSL certificate generation/installation\n- Service enablement\n\n### **Step 8: Final Setup**\n- Installation validation\n- Service health checks\n- Report generation\n- Success confirmation\n\n## 🏗️ Technical Architecture\n\n### **Core Components**\n\n```\nEnhanced Odoo Installer\n├── Configuration Management\n│   ├── Domain validation and DNS checking\n│   ├── SSL certificate type selection\n│   └── Dynamic Odoo configuration generation\n├── Package Management\n│   ├── Official repository integration\n│   ├── Dependency resolution\n│   └── Version compatibility checking\n├── Service Management\n│   ├── Systemd service configuration\n│   ├── Process monitoring\n│   └── Automatic startup configuration\n└── Security Framework\n    ├── User privilege management\n    ├── File permission enforcement\n    └── SSL/TLS implementation\n```\n\n### **Script Structure**\n\n```bash\nodoo_installer.sh\n├── Global Variables \u0026 Configuration\n├── Utility Functions\n│   ├── Logging system\n│   ├── Progress tracking\n│   ├── Error handling\n│   └── User interaction\n├── Validation Functions\n│   ├── System requirements\n│   ├── Network connectivity\n│   └── Version compatibility\n├── Installation Functions\n│   ├── step_preflight_checks()\n│   ├── step_system_preparation()\n│   ├── step_database_setup()\n│   ├── step_dependencies_installation()\n│   ├── step_wkhtmltopdf_installation()\n│   ├── step_odoo_installation()\n│   ├── step_service_configuration()\n│   └── step_final_setup()\n├── Nginx \u0026 SSL Functions\n│   ├── install_official_nginx()\n│   ├── generate_self_signed_ssl()\n│   ├── install_letsencrypt_ssl()\n│   └── create_nginx_odoo_config()\n└── Main Execution Flow\n```\n\n## ⚙️ Configuration Options\n\n### **Odoo Versions Supported**\n- Odoo 14.0 (LTS)\n- Odoo 15.0\n- Odoo 16.0\n- Odoo 17.0\n- Odoo 18.0 (Latest)\n\n### **Installation Modes**\n\n#### **Domain-based Installation**\n```bash\n# User provides domain name\nDomain: odoo.example.com\nSSL: Let's Encrypt (automatic)\nAccess: https://odoo.example.com\n```\n\n#### **IP-based Installation**\n```bash\n# No domain provided\nDomain: Server IP address\nSSL: Self-signed certificate\nAccess: https://[server-ip]\n```\n\n### **Generated Configuration Files**\n\n#### **Odoo Configuration (`/etc/odoo/odoo.conf`)**\n```ini\n[options]\n; Basic Odoo configuration\ndb_host = localhost\ndb_port = 5432\ndb_user = odoo\ndb_password = False\naddons_path = /odoo/odoo/addons\nlogfile = /var/log/odoo/odoo-server.log\nlog_level = info\n; Proxy mode configuration (when Nginx is installed)\nproxy_mode = True\n```\n\n#### **Systemd Service (`/etc/systemd/system/odoo.service`)**\n```ini\n[Unit]\nDescription=Odoo\nDocumentation=http://www.odoo.com\nRequires=postgresql.service\nAfter=postgresql.service\n\n[Service]\nType=simple\nSyslogIdentifier=odoo\nPermissionsStartOnly=true\nUser=odoo\nGroup=odoo\nExecStart=/odoo/odoo/odoo-bin -c /etc/odoo/odoo.conf\nStandardOutput=journal+console\n\n[Install]\nWantedBy=multi-user.target\n```\n\n## 🔒 SSL Certificate Management\n\n### **Let's Encrypt Integration**\n\nThe installer uses Certbot via snapd for Let's Encrypt certificates:\n\n```bash\n# Automatic installation process\n1. Install snapd (if not present)\n2. Install certbot via snap\n3. Create temporary Nginx configuration\n4. Obtain SSL certificate\n5. Configure automatic renewal\n6. Update Nginx configuration\n```\n\n#### **Certificate Renewal**\n```bash\n# Test renewal (dry run)\ncertbot renew --dry-run\n\n# Manual renewal\ncertbot renew\n\n# Automatic renewal (configured by installer)\nsystemctl status snap.certbot.renew.timer\n```\n\n### **Self-signed Certificates**\n\nFor testing or internal use:\n\n```bash\n# Certificate generation\nopenssl req -x509 -nodes -days 365 -newkey rsa:2048 \\\n    -keyout /etc/ssl/nginx/server.key \\\n    -out /etc/ssl/nginx/server.crt \\\n    -subj \"/C=US/ST=State/L=City/O=Organization/OU=OrgUnit/CN=$DOMAIN_NAME\"\n```\n\n## 🌐 Nginx Configuration\n\n### **Reverse Proxy Setup**\n\nThe installer creates a production-ready Nginx configuration:\n\n```nginx\n# Upstream configuration\nupstream odoo {\n  server 127.0.0.1:8069;\n}\nupstream odoochat {\n  server 127.0.0.1:8072;\n}\n\n# HTTP to HTTPS redirect\nserver {\n  listen 80;\n  server_name example.com;\n  rewrite ^(.*) https://$host$1 permanent;\n}\n\n# HTTPS server block\nserver {\n  listen 443 ssl;\n  server_name example.com;\n  \n  # SSL configuration\n  ssl_certificate /path/to/certificate;\n  ssl_certificate_key /path/to/private/key;\n  ssl_protocols TLSv1.2 TLSv1.3;\n  \n  # Proxy configuration\n  location / {\n    proxy_pass http://odoo;\n    proxy_set_header X-Forwarded-Host $http_host;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_set_header X-Forwarded-Proto $scheme;\n    proxy_set_header X-Real-IP $remote_addr;\n  }\n  \n  # WebSocket support\n  location /websocket {\n    proxy_pass http://odoochat;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection $connection_upgrade;\n  }\n}\n```\n\n### **Security Headers**\n\n```nginx\n# Security enhancements\nadd_header Strict-Transport-Security \"max-age=31536000; includeSubDomains\";\nproxy_cookie_flags session_id samesite=lax secure;\n```\n\n## 🔧 Troubleshooting\n\n### **Common Issues**\n\n#### **DNS Resolution Problems**\n```bash\n# Check DNS configuration\ndig +short your-domain.com\n\n# Verify server IP\ncurl -s ifconfig.me\n\n# Test domain resolution\nnslookup your-domain.com\n```\n\n#### **Service Status Checks**\n```bash\n# Check Odoo service\nsystemctl status odoo\njournalctl -u odoo -f\n\n# Check PostgreSQL\nsystemctl status postgresql\nsudo -u postgres psql -l\n\n# Check Nginx (if installed)\nsystemctl status nginx\nnginx -t\n```\n\n#### **Log File Locations**\n```bash\n# Installation logs\n/tmp/odoo_install_YYYYMMDD_HHMMSS.log\n\n# Odoo application logs\n/var/log/odoo/odoo-server.log\n\n# Nginx logs (if installed)\n/var/log/nginx/odoo.access.log\n/var/log/nginx/odoo.error.log\n\n# System logs\njournalctl -u odoo\njournalctl -u nginx\n```\n\n### **Port Configuration**\n\n| Service | Port | Protocol | Purpose |\n|---------|------|----------|---------|\n| Odoo | 8069 | HTTP | Web interface |\n| Odoo | 8072 | HTTP | WebSocket/Chat |\n| Nginx | 80 | HTTP | HTTP redirect |\n| Nginx | 443 | HTTPS | Secure web access |\n| PostgreSQL | 5432 | TCP | Database |\n\n### **File Permissions**\n\n```bash\n# Odoo directories\n/odoo/odoo/          - odoo:odoo (755)\n/etc/odoo/           - odoo:odoo (755)\n/var/log/odoo/       - odoo:odoo (755)\n\n# Configuration files\n/etc/odoo/odoo.conf  - odoo:odoo (640)\n\n# SSL certificates\n/etc/ssl/nginx/      - root:root (644/600)\n```\n\n## 🧪 Testing the Installation\n\n### **Basic Functionality Test**\n```bash\n# Test Odoo web interface\ncurl -I http://localhost:8069\n\n# Test with Nginx (if installed)\ncurl -I https://your-domain.com\n\n# Check database connectivity\nsudo -u odoo psql -h localhost -p 5432 -U odoo -l\n```\n\n### **SSL Certificate Validation**\n```bash\n# Check certificate details\nopenssl x509 -in /path/to/certificate -text -noout\n\n# Test SSL connection\nopenssl s_client -connect your-domain.com:443 -servername your-domain.com\n```\n\n## 📊 Performance Optimization\n\n### **Recommended System Tuning**\n\n#### **PostgreSQL Configuration**\n```sql\n-- /etc/postgresql/16/main/postgresql.conf\nshared_buffers = 256MB\neffective_cache_size = 1GB\nmaintenance_work_mem = 64MB\ncheckpoint_completion_target = 0.9\nwal_buffers = 16MB\ndefault_statistics_target = 100\n```\n\n#### **Nginx Optimization**\n```nginx\n# /etc/nginx/nginx.conf\nworker_processes auto;\nworker_connections 1024;\nkeepalive_timeout 65;\nclient_max_body_size 100M;\n```\n\n#### **Odoo Configuration Tuning**\n```ini\n# /etc/odoo/odoo.conf\nworkers = 4\nmax_cron_threads = 2\nlimit_memory_hard = 2684354560\nlimit_memory_soft = 2147483648\nlimit_request = 8192\nlimit_time_cpu = 600\nlimit_time_real = 1200\n```\n\n## 🔄 Backup and Maintenance\n\n### **Database Backup**\n```bash\n# Create database backup\nsudo -u odoo pg_dump -h localhost -p 5432 -U odoo database_name \u003e backup.sql\n\n# Restore database\nsudo -u odoo psql -h localhost -p 5432 -U odoo -d database_name \u003c backup.sql\n```\n\n### **File System Backup**\n```bash\n# Backup Odoo files\ntar -czf odoo_backup.tar.gz /odoo/odoo /etc/odoo /var/log/odoo\n\n# Backup SSL certificates\ntar -czf ssl_backup.tar.gz /etc/ssl/nginx /etc/letsencrypt\n```\n\n### **Update Procedures**\n```bash\n# Update Odoo to newer version\ncd /odoo/odoo\ngit fetch origin\ngit checkout 17.0  # or desired version\nsudo systemctl restart odoo\n\n# Update system packages\nsudo apt update \u0026\u0026 sudo apt upgrade\n\n# Update SSL certificates\nsudo certbot renew\n```\n\n## 🤝 Contributing\n\nWe welcome contributions to improve the Enhanced Odoo Installer! Here's how you can help:\n\n### **Development Setup**\n```bash\n# Clone the repository\ngit clone https://github.com/mah007/OdooScript.git\ncd OdooScript\n\n# Create a feature branch\ngit checkout -b feature/your-feature-name\n\n# Make your changes and test\n./odoo_installer.sh\n\n# Commit and push\ngit commit -m \"Add your feature description\"\ngit push origin feature/your-feature-name\n```\n\n### **Testing Guidelines**\n- Test on clean Ubuntu 22.04 installations\n- Verify both domain and IP-based installations\n- Test SSL certificate generation (both Let's Encrypt and self-signed)\n- Validate all Odoo versions (14.0-18.0)\n- Check error handling and recovery scenarios\n\n### **Code Style**\n- Use consistent bash scripting practices\n- Add comments for complex logic\n- Follow the existing function naming convention\n- Include proper error handling\n- Update documentation for new features\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- [Odoo](https://www.odoo.com/) for the amazing ERP platform\n- [Nginx](https://nginx.org/) for the high-performance web server\n- [Let's Encrypt](https://letsencrypt.org/) for free SSL certificates\n- [PostgreSQL](https://www.postgresql.org/) for the robust database system\n- The open-source community for continuous inspiration\n\n## 📞 Support\n\n- **Documentation**: [GitHub Wiki](https://github.com/mah007/OdooScript/wiki)\n- **Issues**: [GitHub Issues](https://github.com/mah007/OdooScript/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/mah007/OdooScript/discussions)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Made with ❤️ for the Odoo community By Mahmoud Abdel Latif**\n\n\n[Website](https://mah007.net) • [Documentation](https://github.com/mah007/OdooScript/wiki) • [Issues](https://github.com/mah007/OdooScript/issues)\n\n\u003c/div\u003e\n\n\n\n# OdooScript\nOdoo dependence installation script for Ubuntu 14.04 , 15.04 ,16.04 ,20.04 , 22.04 ,*24.04(universal)  \nmake your envirument ready for all kind of odoo with pycharm IDE\nafter run the script u have to download odoo manully \n\nssh-keygen -t ed25519 -C \"your_email@example.com\"\n\n### Copy this script and run it on your terminal \n\n./odoo-bin -w a -s -c  ../odoo.conf --stop-after-init\n\n./odoo-bin -w a -s -c  /etc/odoo/odoo.conf --stop-after-init\n\nexport LC_ALL=\"en_US.UTF-8\" \u003cbr /\u003e\nexport LC_CTYPE=\"en_US.UTF-8\" \u003cbr /\u003e\nsudo dpkg-reconfigure locales \u003cbr /\u003e\n\n########################################################################\u003cbr /\u003e\nadduser odoo\n\n########################################################################\u003cbr /\u003e\n\napt-get update \u003cbr /\u003e\napt-get install software-properties-common \u003cbr /\u003e\nadd-apt-repository ppa:certbot/certbot \u003cbr /\u003e\napt-get update \u003cbr /\u003e\napt-get install python-certbot-apache \u003cbr /\u003e\nsudo certbot --apache \u003cbr /\u003e\n#######################################################################\u003cbr /\u003e\n\nwget https://raw.githubusercontent.com/mah007/OdooScript/12.0/nginx.sh \u003cbr /\u003e\nbash nginx.sh \u003cbr /\u003e\n\n apt-get update \u003cbr /\u003e\n apt-get install software-properties-common -y \u003cbr /\u003e\n add-apt-repository universe \u003cbr /\u003e\n add-apt-repository ppa:certbot/certbot \u003cbr /\u003e\n apt-get update \u003cbr /\u003e\n apt-get install certbot python-certbot-nginx -y\u003cbr /\u003e\n \n sudo certbot --nginx \u003cbr /\u003e\n\n\n\n#######################################################################\u003cbr /\u003e\n\nnano  /etc/apt/sources.list.d/pgdg.list \u003cbr /\u003e\ndeb deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main \u003cbr /\u003e\nwget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - \u003cbr /\u003e\n\nsudo apt-get update \u003cbr /\u003e\n\n########################################################################\u003cbr /\u003e\n\nsudo su - postgres -c \"createuser -s odoo\" 2\u003e /dev/null || true \u003cbr /\u003e\nwget https://raw.githubusercontent.com/mah007/OdooScript/master/odoo_pro.sh \u003cbr /\u003e\nsudo /bin/sh odoo_pro.sh \u003cbr /\u003e\n\n#\n\nwget http://software.virtualmin.com/gpl/scripts/install.sh \u003cbr /\u003e\nsh /root/install.sh -b LEMP \u003cbr /\u003e\n\n********************PG UTF*********************\u003cbr /\u003e\n\nsudo su postgres \u003cbr /\u003e\npsql \u003cbr /\u003e\nupdate pg_database set datistemplate=false where datname='template1'; \u003cbr /\u003e\ndrop database Template1; \u003cbr /\u003e\ncreate database template1 with owner=postgres encoding='UTF-8' \u003cbr /\u003e\n  lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0; \u003cbr /\u003e\nupdate pg_database set datistemplate=true where datname='template1'; \u003cbr /\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmah007%2Fodooscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmah007%2Fodooscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmah007%2Fodooscript/lists"}