https://github.com/s4tyendra/simple-server-hosting
Simple Server Hosting is a web-based dashboard for managing and deploying applications on an Ubuntu server. It features automatic setup of virtual environments, Nginx configuration, real-time logs, terminal access, domain management, and easy application management from Git repositories.
https://github.com/s4tyendra/simple-server-hosting
application-management deployment dns-checking domain-management git-repositories html management nginx-configuration python python3 real-time-logs server terminal-access ubuntu-server virtual-environments web-based-dashboard
Last synced: 4 months ago
JSON representation
Simple Server Hosting is a web-based dashboard for managing and deploying applications on an Ubuntu server. It features automatic setup of virtual environments, Nginx configuration, real-time logs, terminal access, domain management, and easy application management from Git repositories.
- Host: GitHub
- URL: https://github.com/s4tyendra/simple-server-hosting
- Owner: S4tyendra
- Created: 2024-10-21T11:38:51.000Z (over 1 year ago)
- Default Branch: docker
- Last Pushed: 2025-10-04T15:57:24.000Z (4 months ago)
- Last Synced: 2025-10-04T17:39:31.997Z (4 months ago)
- Topics: application-management, deployment, dns-checking, domain-management, git-repositories, html, management, nginx-configuration, python, python3, real-time-logs, server, terminal-access, ubuntu-server, virtual-environments, web-based-dashboard
- Language: Python
- Homepage:
- Size: 33.2 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# đŗ Docker Manager Dashboard
A slick web-based dashboard for managing Docker containers pulled from GitHub Container Registry (GHCR). Built with Hono + Bun for maximum speed, with automatic Nginx configuration, environment management, and real-time container monitoring.
Perfect for managing your self-hosted infrastructure on IIIT Kota servers (or any Ubuntu/Debian box really).
>
> [!NOTE]
> See [main branch](https://github.com/s4tyendra/simple-server-hosting/tree/main) for non docker and general hosting manager
---
> [!WARNING]
> This repo is highly customized to use with iiitkota servers and infra structure. if you want to use for your apps, please change domain and folder names.
## ⨠Features
â **GHCR Integration**: Auto-discover and pull images from `web-iiitkota` organization
â **Docker Compose Automation**: Generate and manage compose files with resource limits
â **Nginx Auto-Config**: Set up reverse proxy mappings with custom domains (`.iiitkota.ac.in`)
â **Environment Management**: Edit `.env` files directly from the UI
â **Real-time Logs**: Stream container logs with live updates
â **Resource Control**: Set CPU/memory limits, restart policies, port mappings
â **Update Detection**: Shows when newer image versions are available
â **Beautiful UI**: Dark/light theme with glassmorphic cards and smooth animations
---
## đ Prerequisites
- **OS**: Ubuntu/Debian (tested on Ubuntu Server)
- **Runtime**: [Bun](https://bun.sh) (for running the app)
- **Docker**: Docker Engine + Docker Compose v2
- **Nginx**: For reverse proxy (optional but recommended)
- **Sudo Access**: Required for Nginx reloads and container management
---
## đ Installation
### 1ī¸âŖ Install Bun
```bash
curl -fsSL https://bun.sh/install | bash
```
### 2ī¸âŖ Clone the Repo
```bash
git clone https://github.com/s4tyendra/simple-server-hosting.git
cd simple-server-hosting
git checkout docker # Switch to docker branch
```
### 3ī¸âŖ Install Dependencies
```bash
bun install
```
### 4ī¸âŖ Set Environment Variables
Create a `.env` file or export these:
```bash
export GITHUB_PAT="ghp_your_github_personal_access_token"
export AUTH_USERNAME="admin"
export AUTH_PASSWORD="your_secure_password"
export PORT="8080"
```
**Getting a GitHub PAT:**
1. Go to GitHub â Settings â Developer Settings â Personal Access Tokens
2. Generate a new token (classic) with `read:packages` scope
3. Copy and use it as `GITHUB_PAT`
---
## đ Running the App
### Development Mode
```bash
bun run index.ts
```
### Production Mode (with sudo for Nginx control)
```bash
sudo -E bun run index.ts
# The -E flag preserves environment variables
```
Or use a process manager like PM2:
```bash
sudo pm2 start index.ts --interpreter bun --name docker-manager
```
Access at: `http://localhost:8080` (or your configured port)
---
## âī¸ Nginx Setup (Optional but Recommended)
The app can automatically manage Nginx configs for your containers. Here's the base setup:
### 1ī¸âŖ Create the main config file
```bash
sudo nano /etc/nginx/sites-available/iiit-apis
```
Add this base config:
```nginx
# This file is managed by Docker Manager
# Individual server blocks are auto-generated
# Include SSL certificate config
# (Assuming you have SSL set up with Let's Encrypt or similar)
```
### 2ī¸âŖ Enable it
```bash
sudo ln -s /etc/nginx/sites-available/iiit-apis /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
```
### 3ī¸âŖ Give the app write permissions
```bash
sudo chown $USER:$USER /etc/nginx/sites-available/iiit-apis
```
Or run the app with sudo (it needs sudo for `nginx -t` and `systemctl reload nginx` anyway).
---
## đ¯ Usage Guide
### Creating a New Container
1. **Pull/Update Image**: Click "đ Update/Pull" to fetch the latest image from GHCR
2. **Configure Settings**:
- Set **Host Port** (external) and **Container Port** (internal)
- Add **Environment Variables** (format: `KEY=value`)
- Set **Resource Limits** (CPU, Memory)
- Configure **Restart Policy**
3. **Optional - Add Domain**:
- Enter a subdomain (e.g., `api`) to get `api.iiitkota.ac.in`
- Set **Client Max Body Size** for uploads
4. **Start Container**: Click "đ Start" to create and run the container
### Managing Running Containers
- **đ Restart**: Restart the container
- **âšī¸ Stop**: Stop the container (doesn't remove it)
- **đ Logs**: View real-time container logs
- **đī¸ Remove**: Delete the container (image stays)
### Updating Containers
1. Pull the new image version (it'll show "update_available" status)
2. Open **Environment & Configuration** section
3. Click **đž Save & Recreate Container**
4. This stops, removes, and recreates the container with new image + settings
### Editing Nginx Directly
Click **⥠Nginx** button â Edit the config â **đž Save, Test & Reload**
The app will:
1. Backup the old config
2. Write your changes
3. Run `sudo nginx -t` to test
4. Reload Nginx if test passes
5. Restore backup if test fails
---
## đ Project Structure
```
~/.dckr/
âââ env/
âââ /
âââ .env # Environment variables
âââ config.json # Resource limits & settings
âââ docker-compose.yml # Auto-generated compose file
```
---
## đ Security Notes
â ī¸ **This app requires sudo access** for:
- Nginx testing and reloading
- Docker operations (if not in docker group)
đĄī¸ Recommendations:
- Use strong passwords for basic auth
- Keep `GITHUB_PAT` secure (read-only scope)
- Run behind a firewall (only expose port 443 publicly)
- Use SSL/TLS in production (Let's Encrypt)
- Restrict `~/.dckr/env/` directory permissions
---
## đ Troubleshooting
### "Permission denied" when managing containers
â Add your user to the docker group:
```bash
sudo usermod -aG docker $USER
newgrp docker
```
### Nginx test fails but config looks correct
â Check for duplicate `server_name` directives:
```bash
sudo nginx -T | grep server_name
```
### Container won't start
â Check logs in the UI or via:
```bash
docker logs
```
### Domain not resolving
â Verify DNS A record points to your server IP:
```bash
dig +short subdomain.iiitkota.ac.in
```
---
## đ¤ Contributing
Found a bug? Want a feature? PRs are welcome!
1. Fork the repo
2. Create your feature branch (`git checkout -b feature/cool-thing`)
3. Commit changes (`git commit -m 'Add cool thing'`)
4. Push to branch (`git push origin feature/cool-thing`)
5. Open a PR
---
## đ License
MIT License - do whatever you want with it, I'm not even including License file!
---
## đŦ Support
Issues? Questions? Open an issue on GitHub or reach out at [satya@satyendra.in](mailto:satya@satyendra.in)
Built with đ for IIIT Kota infrastructure by [@s4tyendra](https://github.com/s4tyendra)