Debian 12 Server Setup
1. System Update
2. Install Required Tools
3. Install Nginx
4. Install MongoDB
5. Install Certbot
6. Create Nginx Configuration
Paste this configuration:
7. Enable Nginx Configuration
8. Setup SSL Certificate
9. Configure MongoDB Security
In MongoDB shell:
Edit MongoDB config
Add these lines:
Restart MongoDB
10. Install and Configure UFW Firewall
Cloudflare Setup Steps
Verification Commands
Check Nginx status
Check MongoDB status
Check SSL certificate
Test MongoDB authentication
Maintenance Commands
System updates
View Nginx logs
View MongoDB logs
Security Checklist
Best Practices
Additional Debian 12 Specific Security
Install fail2ban
Configure automatic updates
Secure shared memory
Enable automatic security updates
Troubleshooting
Useful Resources
Last updated