https://github.com/mel-cell/docktop
DockTop is a modern, feature-rich terminal user interface for managing Docker containers. Built with Rust and Ratatui, it provides real-time monitoring, interactive wizards, and a beautiful interface inspired by btop.
https://github.com/mel-cell/docktop
apache container devops docker linux management-server management-system mysql nginx postgresql redux rust shell
Last synced: 8 days ago
JSON representation
DockTop is a modern, feature-rich terminal user interface for managing Docker containers. Built with Rust and Ratatui, it provides real-time monitoring, interactive wizards, and a beautiful interface inspired by btop.
- Host: GitHub
- URL: https://github.com/mel-cell/docktop
- Owner: mel-cell
- License: mit
- Created: 2025-06-07T21:09:08.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-12-27T11:23:28.000Z (4 months ago)
- Last Synced: 2025-12-29T05:00:48.369Z (4 months ago)
- Topics: apache, container, devops, docker, linux, management-server, management-system, mysql, nginx, postgresql, redux, rust, shell
- Language: Batchfile
- Homepage:
- Size: 7.51 MB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DockTop ๐ณ

**A beautiful, interactive TUI (Terminal User Interface) for Docker container management**
[](LICENSE)
[](https://www.rust-lang.org/)
[](https://www.docker.com/)
---
DockTop is a modern, feature-rich terminal user interface for managing Docker containers. Built with Rust and Ratatui, it provides real-time monitoring, interactive wizards, and a beautiful interface inspired by btop.
### โจ Key Features
- ๐จ **Beautiful UI** - Btop-inspired design with customizable themes
- ๐ **Real-time Monitoring** - Live CPU, memory, and network statistics
- ๐ **Container Management** - Start, stop, restart, and remove containers
- ๐ **Animated Background** - Relaxing fish tank animation
- ๐ **ASCII Globe** - Rotating Earth animation in the tools sidebar
- ๐ง **Interactive Wizards** - Step-by-step guides for:
- Quick Pull & Run containers
- Build from Dockerfile
- Docker Compose generation
- ๐งน **Janitor** - Clean up unused containers, images, and volumes
- โ๏ธ **Settings System** - Configure theme, refresh rate, and behavior directly in the app
- โก **Eco Mode** - Adaptive refresh rate to save CPU when idle
- ๐ **Live Logs** - Real-time container log streaming
- ๐ฏ **Resource Allocation** - Smart resource management for databases
- ๐จ **Theme Support** - Load custom btop-style themes
---
## ๐ Installation
### Prerequisites
- **Docker** - Required for container management
- **Rust** (optional) - Will be installed automatically if missing
### Quick Install
Clone the repository and run the installation script:
```bash
git clone https://github.com/mel-cell/docktop.git
cd docktop
chmod +x install.sh
./install.sh
```
The installation script will:
1. โ
Check for Rust and install it if needed
2. โ
Check for Docker (warns if missing)
3. โ
Build the project in release mode
4. โ
Install the binary to `/usr/local/bin/docktop`
### Manual Installation
If you prefer to install manually:
```bash
# Build the project
cargo build --release
# Copy the binary to your PATH
sudo cp target/release/docktop /usr/local/bin/docktop
# Or install to user directory
cp target/release/docktop ~/.cargo/bin/docktop
```
---
## ๐ฎ Usage
Simply run `docktop` from anywhere in your terminal:
```bash
docktop
```
### Keyboard Shortcuts
#### Navigation
- `โ/โ` or `j/k` - Navigate containers
- `Tab` - Switch between sections / Open Tools Menu
- `?` - Open Help / Shortcuts Menu
- `q` or `Ctrl+C` - Quit application
#### Container Actions
- `Enter` - View container details
- `s` - Start container
- `t` - Stop container
- `r` - Restart container
- `d` - Remove container
- `y` - Edit container config (YAML)
- `l` - View logs
- `F5` - Force refresh container list
#### Tools & Wizards
- `Tab` - Open wizard menu
- `Esc` - Cancel/Go back
- `Enter` - Confirm selection
- `Ctrl+A` - Toggle Advanced Options (in Wizard)
- `Space` - Cycle options (e.g., Restart Policy in Wizard)
---
## ๐ Self-Update
DockTop comes with a built-in self-update mechanism. To update to the latest version:
```bash
docktop update
```
This command will check for the latest release on GitHub, download the binary, and replace the current installation.
---
## โ๏ธ Configuration
### Settings UI
You can configure DockTop directly within the application:
1. Press `Tab` to open the Tools menu.
2. Select **Settings**.
3. Use `Up/Down` to navigate and `Left/Right` to change values.
4. Press `S` to save or `Esc` to cancel.
### Configuration File
DockTop stores configuration in `config.toml` (in the current directory or `~/.config/docktop/config.toml`):
```toml
# DockTop Configuration
theme = "monochrome"
show_braille = true
refresh_rate_ms = 1000
confirm_before_delete = true
default_socket = "unix:///var/run/docker.sock"
```
### Theme Customization
DockTop supports btop-style themes. Create or modify theme files in the `themes/` directory:
```bash
themes/
โโโ monochrome.theme
โโโ dracula.theme
โโโ matrix.theme
โโโ custom.theme
```
#### Theme File Format
```ini
# Theme colors
theme[main_bg]="#00"
theme[main_fg]="#cc"
# ... (standard btop theme format)
```
---
## ๐ง Wizards & Tools
### Quick Pull & Run
Quickly pull and run containers from Docker Hub:
1. Press `Tab` to open the wizard menu
2. Select "Quick Pull & Run"
3. Enter image name (e.g., `nginx:latest`)
4. Configure ports, environment variables, and resources
5. Press Enter to launch
### Build from Dockerfile
Build and run from local Dockerfile:
1. Press `Tab` to open the wizard menu
2. Select "Build from Source"
3. Browse to your project directory
4. DockTop will auto-detect the framework (Node.js, Python, Go, etc.)
5. Configure build settings and run
### Docker Compose Generator
Generate production-ready docker-compose.yml files:
1. Press `Tab` to open the wizard menu
2. Select "Docker Compose"
3. Choose your services (databases, caches, etc.)
4. DockTop automatically calculates optimal resource allocation
5. Review and save the generated compose file
### Janitor
Clean up unused resources:
1. Press `Tab` to open the wizard menu
2. Select "Janitor"
3. Scan for dangling images, stopped containers, and unused volumes
4. Select items to clean and confirm
---
## ๐จ Features in Detail
### Real-time Monitoring
- **CPU Usage** - Per-container CPU utilization with history graphs
- **Memory** - RAM usage with detailed breakdowns
- **Network** - RX/TX bandwidth monitoring
- **Disk I/O** - Read/write statistics
### Container Details
View comprehensive information about each container:
- Container ID and Name
- Image and Tag
- Status and Uptime
- Port Mappings
- Environment Variables
- Volume Mounts
- Network Configuration
### Log Streaming
Real-time log viewing with:
- Auto-scroll
- Color-coded output
- Search and filter (coming soon)
- Export logs (coming soon)
---
## ๐ ๏ธ Development
### Building from Source
```bash
# Clone the repository
git clone https://github.com/yourusername/docktop.git
cd docktop
# Build in debug mode
cargo build
# Run in development
cargo run
# Build optimized release
cargo build --release
```
### Project Structure
```
docktop/
โโโ src/
โ โโโ main.rs # Entry point
โ โโโ app.rs # Application state and logic
โ โโโ ui.rs # UI rendering
โ โโโ docker.rs # Docker API integration
โ โโโ theme.rs # Theme parsing and management
โโโ assets/
โ โโโ earthAnimation.bat # ASCII globe animation
โโโ themes/ # Theme files
โโโ install.sh # Installation script
โโโ Cargo.toml # Dependencies
```
### Dependencies
- **tokio** - Async runtime
- **ratatui** - TUI framework
- **crossterm** - Terminal manipulation
- **bollard** - Docker API client
- **serde** - Serialization
- **sysinfo** - System information
- **chrono** - Date/time handling
---
## ๐ค 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](LICENSE) file for details.
---
## ๐ Acknowledgments
- Inspired by [btop](https://github.com/aristocratos/btop) for the beautiful design
- Built with [Ratatui](https://github.com/ratatui-org/ratatui)
- Docker integration via [Bollard](https://github.com/fussybeaver/bollard)
---
## ๐ง Contact
For questions, suggestions, or issues, please open an issue on GitHub.
---
**Made with โค๏ธ and ๐ฆ Rust**