This script is a comprehensive tool for managing multiple Ubuntu VPS servers. It handles installation and management of essential services, including Docker, Docker Compose, ERPNext, and NADOO-IT services.
- Clone this repository:
git clone https://github.com/NADOOIT/Auto-Ubuntu-VPS-Server-Setup-Script.git
cd Auto-Ubuntu-VPS-Server-Setup-Script
- Make the scripts executable:
chmod +x manage_servers.sh lib/service_manager.sh
- Run the management interface:
./manage_servers.sh
-
Multiple Server Management
- Add and remove servers
- Store server configurations
- Track installed services per server
-
Service Management
- Docker and Docker Compose
- NGINX Proxy Manager
- Portainer
- WordPress
- ERPNext
- NADOO-IT Services
- RustDesk Server
-
NADOO-IT Service Management
- Automated backups
- Safe updates with rollback capability
- Database management
-
SSH Key Management
- Automatic key generation and distribution
- Password-less authentication
- Secure connection management
Before using the script, ensure you have:
- A Unix-like operating system (Linux/macOS)
- SSH client installed
jq
command-line JSON processorexpect
for handling interactive promptssqlite3
for database management
The script will automatically check for and install missing requirements.
-
Adding a Server
- Select "Add Server" from the main menu
- Enter server details (name, IP, SSH user)
- The system will automatically configure SSH access
-
Managing Services
- Select "Manage Server Services" from the main menu
- Choose a server to manage
- Install or remove services as needed
- Update and backup NADOO-IT services
-
SSH Access
- The system automatically manages SSH keys
- First-time connection requires password
- Subsequent connections are password-less
- Keys are stored securely in
~/.ssh/
The script handles SSH key management automatically:
-
First-time Setup
./manage_servers.sh
- Select "Add Server"
- Enter server details
- The system will:
- Generate SSH key if needed
- Copy public key to server
- Configure password-less authentication
-
Manual SSH Access
./manage_servers.sh ssh <server-name>
Or use the interactive menu:
- Select "SSH to Server" from the main menu
- Choose the server to connect to
-
Backup
- Automatically performed before updates
- Stored in
config/backups/
- Includes SQLite database
- Timestamped for easy reference
-
Update
- Creates backup automatically
- Stashes local changes
- Pulls latest updates
- Automatic rollback on failure
All service configurations are stored in:
config/servers.json
- Server configurationsconfig/backups/
- Service backups- Docker Compose files in the root directory
-
SSH Connection Issues
- Check server IP and credentials
- Ensure SSH service is running
- Verify firewall settings
- Use "Reset SSH Key" option if needed
-
Service Installation Failures
- Check server connectivity
- Verify system requirements
- Check disk space
- Review logs in
config/logs/
-
Update Failures
- Automatic rollback will restore previous state
- Check backup directory for database restore
- Review update logs
- Contact support if needed
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.