A comprehensive bash script collection for quickly setting up and managing VPS servers with support for multiple web stacks including Laravel, WordPress, Node.js, Docker applications, and more.
- 🖥️ Server Management: System updates, security hardening, firewall configuration
- 👥 User Management: Create/delete users, manage SSH keys, sudo permissions
- 🌐 Domain Management: Multi-stack support with automatic Nginx configuration
- 🗄️ Database Management: MySQL/MariaDB installation, database creation, backup/restore, optimization
- 🐳 Docker Support: Pre-configured Docker applications (Ghost, n8n, etc.)
- 🔒 SSL/TLS: Automatic Let's Encrypt certificate installation
- 📦 Stack Support: Laravel, WordPress, Node.js, PHP, Static sites
- 🔐 Security: Best practices with proper user permissions and security headers
- Ubuntu 20.04+ (Tested on Ubuntu 22.04)
- Root or sudo access
- Internet connection
# Clone the repository
git clone https://github.com/yourusername/QuickVPS.git
cd QuickVPS
# Make the script executable
chmod +x setup.sh
# Run the setup
sudo ./setup.sh- Server Setup: Initial server configuration, security hardening
- User Management: Create/manage users and SSH access
- Domain Setup: Configure domains with various web stacks
- Database Management: MySQL/MariaDB installation, database creation, backup/restore
- Docker Apps: Deploy pre-configured Docker applications
| Stack | Description | Features |
|---|---|---|
| Laravel | PHP Laravel Framework | Composer, .env setup, artisan commands, proper permissions |
| WordPress | WordPress CMS | MySQL/MariaDB integration, wp-config setup |
| Node.js | Express.js applications | PM2 process manager, automatic startup |
| PHP | Native PHP applications | PHP-FPM integration |
| Static | Static HTML/CSS/JS sites | Basic nginx configuration |
| Docker | Containerized applications | Docker Compose, volume management |
sudo ./setup.sh
# Select: 3) Domain Setup
# Select: 2) Add Domain
# Enter domain: yourdomain.com
# Select stack: 2) Laravel
# Choose to clone from Git: y
# Enter repository URL: https://github.com/yourusername/laravel-app.gitQuickVPS/
├── setup.sh # Main entry script
├── modules/
│ ├── server.sh # Server configuration
│ ├── user.sh # User management
│ ├── domain.sh # Domain and stack setup
│ ├── docker.sh # Docker applications
│ └── utils.sh # Utility functions
├── templates/
│ ├── nginx_*.conf.template # Nginx configuration templates
│ ├── *.php/.html # Default files for stacks
│ └── docker/ # Docker compose templates
│ ├── ghost/
│ └── n8n/
├── README.md
└── CHANGELOG.md
nginx_laravel.conf.template- Laravel with proper rewrite rulesnginx_wordpress.conf.template- WordPress with PHP-FPMnginx_node.conf.template- Node.js reverse proxynginx_docker.conf.template- Docker container proxynginx_static.conf.template- Static site serving
- Ghost: Blog platform with MySQL
- n8n: Workflow automation platform
- More templates can be added in
templates/docker/
- Automatic firewall (UFW) configuration
- SSH key-based authentication setup
- Fail2ban integration for brute force protection
- Security headers in Nginx configurations
- Non-root user execution for applications
- Proper file permissions and ownership
sudo ./setup.sh
# Select: 1) Server Setup
# Follow prompts for timezone, packages, firewallsudo ./setup.sh
# Select: 2) User Management
# Select: 1) Add User
# Enter username and configure SSH accesssudo ./setup.sh
# Select: 3) Domain Setup
# Select: 2) Add Domain
# Enter domain name
# Select: 3) WordPress
# Configure database and admin usersudo ./setup.sh
# Select: 4) Database Management
# Select: 2) Create Database
# Enter database name: myapp_production
# Enter username: myapp_user
# Select: 1) Generate random password
# Credentials will be saved to /root/db_credentials_myapp_production.txtsudo ./setup.sh
# Select: 4) Docker Apps
# Select application (Ghost, n8n, etc.)
# Configure ports and environment-
Permission Denied (Git Clone)
- Use HTTPS URL instead of SSH:
https://github.com/user/repo.git - Or setup SSH keys for the server
- Use HTTPS URL instead of SSH:
-
Composer/Artisan Permission Issues
- Script automatically handles this by running as www-data user
- Fallback to root with proper warnings if needed
-
Nginx Configuration Issues
- Check
/var/log/nginx/error.log - Verify domain DNS points to server IP
- Check
-
SSL Certificate Issues
- Ensure domain is properly pointed to server
- Check port 80/443 are open in firewall
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Nginx community for excellent documentation
- Laravel community for deployment best practices
- Docker community for containerization standards
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Include server OS, error messages, and steps to reproduce
Made with ❤️ for the DevOps community