Skip to content

sieekuu/DockMaster-PHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐳 DockMaster-PHP

DockMaster-PHP Version License

A Professional, Self-Hosted Docker Compose Management Dashboard

Beautiful β€’ Secure β€’ Easy to Use

Features β€’ Installation β€’ Usage β€’ Screenshots β€’ License


πŸ“‹ About

DockMaster-PHP is a production-ready, self-hosted web application for managing Docker containers and Docker Compose stacks. Built with modern web technologies and a stunning dark-mode interface, it provides an intuitive way to deploy, monitor, and manage your containerized applications.

Author & Contact

πŸ‘€ Krzysztof Siek
πŸ“§ Email: krzysiek@sieekuu.xyz
πŸ“… Year: 2026
βš–οΈ License: MIT


✨ Features

🎯 Core Functionality

  • πŸ“¦ Project Management - Deploy, start, stop, restart, and delete Docker Compose projects
  • πŸ“Š Real-Time Monitoring - Live CPU and memory usage statistics with Chart.js
  • πŸ“‹ Log Viewer - Real-time log streaming from containers
  • βš™οΈ YAML Editor - Built-in Ace Editor for editing docker-compose.yml files

πŸͺ App Store (Template System)

Pre-configured templates for popular applications:

  • πŸ“ WordPress - Popular CMS with MySQL
  • πŸ”’ Nginx Proxy Manager - Reverse proxy with SSL
  • ☁️ Nextcloud - Self-hosted file sync and share
  • 🐳 Portainer - Docker management UI
  • πŸ”€ Traefik - Modern reverse proxy
  • πŸ—„οΈ MySQL - Relational database
  • 🐘 PostgreSQL - Advanced database
  • ⚑ Redis - In-memory data store

πŸ”Œ Port Grid Visualizer

  • Scan ports 8000-9000 in real-time
  • Visual grid showing free (🟒) and taken (πŸ”΄) ports
  • Click to select and copy port numbers
  • Smart port picker for deployment wizard

🎨 Modern UI/UX

  • Dark Mode - Cyberpunk-inspired glassmorphism design
  • Responsive - Works on desktop, tablet, and mobile
  • Animated - Smooth transitions and hover effects
  • Accessible - Clean, intuitive interface

πŸ›‘οΈ Security

  • Authentication - Simple username/password login
  • Input Validation - All user inputs are sanitized
  • Secure Commands - Shell commands properly escaped using escapeshellarg()
  • Session Management - Time-limited sessions with auto-logout

πŸš€ Installation

Prerequisites

  • PHP 8.2+ with CLI access
  • Docker and Docker Compose installed
  • Web Server (Apache/Nginx) or PHP built-in server
  • Linux/Unix system (tested on Ubuntu/Debian)

Step 1: Clone the Repository

git clone https://github.com/sieekuu/dockmaster-php.git
cd dockmaster-php

Step 2: Set Permissions

# Make sure the web server can write to necessary directories
chmod -R 755 public/
chmod -R 755 src/
mkdir -p projects data
chmod -R 777 projects data

# IMPORTANT: Add web server user to docker group
sudo usermod -aG docker www-data
sudo systemctl restart apache2  # or nginx

Step 3: Configure

Edit config.php to customize settings:

// Change the default password!
define('AUTH_PASSWORD', password_hash('your_secure_password', PASSWORD_BCRYPT));

// Adjust port scanning range if needed
define('PORT_SCAN_START', 8000);
define('PORT_SCAN_END', 9000);

// Set your timezone
date_default_timezone_set('Europe/Warsaw');

Step 4: Start the Application

Option A: PHP Built-in Server (Development)

cd public
php -S 0.0.0.0:8080

Then visit: http://localhost:8080

Option B: Apache Configuration (Production)

<VirtualHost *:80>
    ServerName dockmaster.example.com
    DocumentRoot /var/www/dockmaster-php/public

    <Directory /var/www/dockmaster-php/public>
        Options -Indexes +FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/dockmaster-error.log
    CustomLog ${APACHE_LOG_DIR}/dockmaster-access.log combined
</VirtualHost>

Option C: Nginx Configuration (Production)

server {
    listen 80;
    server_name dockmaster.example.com;
    root /var/www/dockmaster-php/public;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

Step 5: Login

Default credentials:

  • Username: admin
  • Password: dockmaster (change this immediately!)

πŸ“– Usage

Dashboard

The main dashboard displays:

  • Statistics Cards - Active projects, port usage, resource metrics
  • Project List - All Docker Compose projects with status
  • Resource Charts - CPU and memory usage visualization
  • Quick Actions - Start, stop, restart, view logs, delete

Deploying Applications

  1. Click "Deploy App" in the navigation
  2. Choose a template from the App Store, or write custom YAML
  3. Configure variables (domain, ports, passwords)
  4. Review generated docker-compose.yml
  5. Click "Deploy Now"

Port Picker

When configuring a template:

  1. Click the "πŸ” Pick Port" button next to a port field
  2. View the port grid (green = free, red = taken)
  3. Click a free port to select it
  4. Port is automatically copied to clipboard

Managing Projects

From the dashboard:

  • ▢️ Start - Start a stopped project
  • πŸ”„ Restart - Restart a running project
  • ⏸️ Stop - Stop a running project
  • πŸ“‹ Logs - View container logs in real-time
  • πŸ—‘οΈ Delete - Remove project completely

πŸ“ Project Structure

DockMaster-PHP/
β”œβ”€β”€ config.php                 # Main configuration file
β”œβ”€β”€ LICENSE                    # MIT License
β”œβ”€β”€ README.md                  # This file
β”œβ”€β”€ src/                       # Backend PHP classes
β”‚   β”œβ”€β”€ DockerService.php      # Docker command wrapper
β”‚   β”œβ”€β”€ PortManager.php        # Port scanning logic
β”‚   └── TemplateManager.php    # App template manager
β”œβ”€β”€ public/                    # Web-accessible files
β”‚   β”œβ”€β”€ index.php              # Dashboard (main page)
β”‚   β”œβ”€β”€ deploy.php             # Deployment wizard
β”‚   β”œβ”€β”€ api.php                # AJAX API endpoint
β”‚   └── assets/
β”‚       β”œβ”€β”€ css/
β”‚       β”‚   └── style.css      # Custom styling
β”‚       └── js/
β”‚           └── app.js         # Frontend JavaScript
β”œβ”€β”€ projects/                  # Docker Compose projects
└── data/                      # Application data

πŸ”’ Security Considerations

  1. Change Default Password - Edit config.php immediately after installation
  2. HTTPS Recommended - Use SSL/TLS in production (Let's Encrypt, Cloudflare)
  3. Firewall Rules - Restrict access to management ports
  4. Docker Socket - Be aware that access to Docker socket = root access
  5. Regular Updates - Keep PHP, Docker, and system packages updated
  6. File Permissions - Ensure only web server can write to projects/ and data/

πŸ› οΈ Tech Stack

Component Technology
Backend PHP 8.2+ (Strict Types, OOP)
Frontend Bootstrap 5 (Dark Theme), Vanilla JS (ES6)
Code Editor Ace Editor 1.32+
Charts Chart.js 4.4+
Database SQLite (for app data)
Container Runtime Docker + Docker Compose

πŸ› Troubleshooting

Docker Permission Issues

# Add your user to docker group
sudo usermod -aG docker $USER
newgrp docker

# Add web server user to docker group
sudo usermod -aG docker www-data
sudo systemctl restart apache2

Port Already in Use

# Find what's using a port
sudo lsof -i :8080
# or
sudo netstat -tulpn | grep 8080

# Kill the process
sudo kill -9 <PID>

PHP Extensions Required

sudo apt-get install php8.2-cli php8.2-mbstring php8.2-sqlite3

🚧 Roadmap

  • Multi-user support with roles
  • Docker Swarm support
  • Backup/restore functionality
  • Webhook integrations
  • Email notifications
  • Custom template creation UI
  • Docker network management
  • Volume management interface

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2026 Krzysztof Siek <krzysiek@sieekuu.xyz>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...

πŸ“ž Support & Contact

Krzysztof Siek
πŸ“§ krzysiek@sieekuu.xyz

For bug reports and feature requests, please use the GitHub Issues page.


Made with ❀️ and β˜• by Krzysztof Siek

⭐ Star this repository if you find it useful!

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors