A clean, modern Docker container manager for Cockpit that properly handles Content Security Policy (CSP) and follows PatternFly design guidelines.
"Portly" - because it manages your container ports and keeps your Docker environment shipshape! ⚓🐳
- ✅ CSP Compliant: No inline styles or scripts
- ✅ PatternFly 6: Modern, consistent UI
- ✅ Real-time Updates: Auto-refresh every 30 seconds
- ✅ Container Management: Start, stop, restart, update, delete containers
- ✅ Log Viewing: View container logs with ANSI colour rendering
- ✅ Compose Viewer: View docker-compose files for compose-managed containers
- ✅ Smart Port Links: Auto-detect HTTP/HTTPS with manual override
- ✅ Dark Mode: Matches Cockpit's dark theme
- ✅ Responsive: Works on all screen sizes
sudo bash install.shsudo mkdir -p /usr/share/cockpit/portly/ui /usr/share/cockpit/portly/backend
sudo cp manifest.json index.html po.js po.manifest.js icon.svg /usr/share/cockpit/portly/
sudo cp ui/* /usr/share/cockpit/portly/ui/
sudo cp backend/* /usr/share/cockpit/portly/backend/
sudo systemctl restart cockpitmkdir -p ~/.local/share/cockpit/portly/ui ~/.local/share/cockpit/portly/backend
cp manifest.json index.html po.js po.manifest.js icon.svg ~/.local/share/cockpit/portly/
cp ui/* ~/.local/share/cockpit/portly/ui/
cp backend/* ~/.local/share/cockpit/portly/backend/Then restart Cockpit or just refresh your browser.
- Cockpit 276 or newer
- Docker installed and running
- User must have permissions to run Docker commands (or sudo access)
portly/
├── index.html # Main UI structure & script loading
├── manifest.json # Cockpit plugin metadata
├── install.sh # Installation script
├── icon.svg # Sidebar icon
├── po.js # Cockpit i18n stub
├── po.manifest.js # Cockpit i18n manifest stub
├── ui/ # Presentation layer
│ ├── base.css # Body, layout, toolbar, title, utilities
│ ├── components.css # Buttons, table, badges, alerts, spinner
│ ├── ports.css # Port links & protocol toggle
│ ├── modals.css # Backdrop, modal box, close button, text viewer
│ ├── kebab.css # Kebab button & context menu
│ ├── darkmode.js # Cockpit theme synchronisation
│ ├── ports.js # Port parsing & protocol toggle
│ ├── textviewer.js # Generic text viewer modal (logs, compose)
│ ├── modals.js # Confirm dialog
│ ├── kebab.js # Context menu component
│ └── render.js # Table rendering & section toggling
├── backend/ # Logic layer
│ ├── docker.js # Thin Docker CLI wrapper (one function per command)
│ ├── containers.js # Container orchestration (update, rollback, compose)
│ └── main.js # Controller — wires UI to backend
└── README.md
The plugin is split into two layers with a clean boundary:
-
ui/handles everything visual: CSS, DOM rendering, dark mode, modals, menus. UI modules expose their API onwindow.Portly(e.g.Portly.render,Portly.textViewer). -
backend/has two layers:docker.jsis a thin CLI wrapper (one function per Docker command, returns the cockpit proc), whilecontainers.jscomposes those calls into higher-level operations like update-with-rollback, compose file resolution, and output parsing. -
backend/main.jsis the controller that ties everything together: it defines the action map, sets up event listeners, and manages the refresh cycle.
- No CSP Violations: All styles are in external CSS files
- No Terminal.js Issues: Uses native Cockpit spawn API
- Proper MIME Types: All resources served correctly
- Better Error Handling: Clear error messages
- Modern UI: PatternFly 6 components
- Modular Code: Clean separation of UI and backend logic
After installation:
- Navigate to your Cockpit interface (usually https://your-server:9090)
- Look for "Portly" in the sidebar
- View all containers with their status
- Use the kebab menu (⋮) or right-click to:
- Start / Stop / Restart containers
- Update containers (pull + recreate)
- View logs (with ANSI colour support)
- View compose files
- Delete containers
Ensure Docker is installed:
sudo apt install docker.io # Debian/Ubuntu
sudo dnf install docker # Fedora/RHELAdd your user to the docker group:
sudo usermod -aG docker $USERCheck Cockpit logs:
sudo journalctl -u cockpit -fTo modify the plugin:
- Edit files in the plugin directory
- Refresh your browser (Ctrl+Shift+R)
- Check browser console for errors
This is a custom Cockpit plugin. Cockpit itself is licensed under LGPL 2.1+.