Automated installation script for deploying a Django-based website with Nginx, Gunicorn, and SSL.
- ✅ Automated system setup
- ✅ Python 3 + Virtual environment
- ✅ Django + Gunicorn
- ✅ Nginx reverse proxy
- ✅ SSL certificate (Let's Encrypt)
- ✅ Media file handling (up to 700 MB)
- ✅ Database migrations
- ✅ Admin user creation
- ✅ Customizable site name and branding
- ✅ Optional Telegram/Facebook links
- Fresh Ubuntu 22.04+ VPS
- Root access
- Domain name pointed to your server IP (A record)
- At least 1GB RAM
wget https://raw.githubusercontent.com/yannaing86tt/website/main/install.sh -O /tmp/install.sh
bash /tmp/install.shAlternative (may use cached version):
curl -sSL https://raw.githubusercontent.com/yannaing86tt/website/main/install.sh | bashThe script will ask you for:
- Domain name (e.g., example.com)
- Website name (displayed in header and title)
- Footer name (copyright owner name)
- Telegram channel URL (optional - press Enter to skip)
- Facebook page URL (optional - press Enter to skip)
- Admin username
- Admin password
- Admin email
Domain name: example.com
Website name: My Tech Blog
Footer name: John Doe
Telegram URL: https://t.me/mychannel (or press Enter)
Facebook URL: https://facebook.com/mypage (or press Enter)
Admin username: admin
Admin password: ********
Admin email: admin@example.com
- Python 3.12 + pip + venv + dev tools
- Nginx web server
- Certbot (SSL certificates)
- Build tools (gcc, make, etc.)
- Git
- All Python dependencies from
requirements.txt - Gunicorn WSGI server
- SQLite database
After installation completes:
- Visit
https://yourdomain.comto see your website - Access admin panel at
https://yourdomain.com/panel - Login with the credentials you provided
- Website code:
/opt/mysite - Media files:
/opt/mysite/media - Static files:
/opt/mysite/staticfiles - Environment:
/opt/mysite/.env - Database:
/opt/mysite/db.sqlite3 - Service:
/etc/systemd/system/mysite.service - Nginx config:
/etc/nginx/sites-available/mysite
systemctl restart mysite.servicejournalctl -u mysite.service -fsystemctl reload nginxnano /opt/mysite/.env
systemctl restart mysite.service- Max file size: 700 MB
- Timeout: 5 minutes per upload
To remove everything and start fresh:
# Stop services
systemctl stop mysite.service nginx
# Remove service
systemctl disable mysite.service
rm -f /etc/systemd/system/mysite.service
systemctl daemon-reload
# Remove files
rm -rf /opt/mysite
# Remove software
apt-get purge -y nginx nginx-common certbot python3-certbot-nginx python3-pip python3-venv python3-dev build-essential git
rm -rf /etc/nginx /etc/letsencrypt
# Clean up
apt-get autoremove -y
apt-get autoclean -y- Make sure you enter all required fields (don't leave them empty)
- Use the wget method instead of curl
- Verify DNS records are pointing to your server
- Check firewall allows ports 80 and 443
- Run manually:
certbot --nginx -d yourdomain.com
- Check logs:
journalctl -u mysite.service -n 50 - Verify database permissions:
ls -la /opt/mysite/db.sqlite3 - Restart service:
systemctl restart mysite.service
The following can be customized during installation:
- Website name (appears in header, title, footer)
- Footer copyright name
- Telegram channel link (optional)
- Facebook page link (optional)
All settings are stored in /opt/mysite/.env and can be changed after installation.
For issues or questions, open an issue on GitHub.
MIT License