Skip to content

Cockpit

Cockpit is a web-based interface for Linux servers that allows for easy system management, log inspection, and performance monitoring. It provides a real-time view of CPU, memory, and disk usage, as well as an integrated terminal.

PortProtocolPurpose
9090TCPWeb UI and API
Access MethodURL
Local networkhttp://nixos.local:9090
Cloudflare Tunnelhttps://cockpit-home.javiersc.com

This service does not require authentication credentials managed by 1Password. It uses the system’s PAM authentication (local user accounts).

This service is stateless and does not require backup of its own data. It acts as an interface to the underlying OS.

Symptom: The integrated terminal in the Cockpit UI fails to connect or shows a blank screen.

Cause: This is often caused by a proxy configuration that doesn’t correctly handle WebSockets.

Solution: Ensure that the Nginx proxy is configured with proxyWebsockets = true. This is handled automatically by the homelab.proxies configuration in this homelab.

Terminal window
journalctl -fu cockpit

Symptom: The login page loads, but after entering credentials, the UI shows a “Connection failed” banner.

Cause: Cockpit’s CSRF protection rejects requests if the Origin header doesn’t match its allowed origins list.

Solution: The Origins list in modules/nixos/services/cockpit.nix must include the exact domain and port used for access.

services.cockpit.settings.WebService.Origins = lib.mkForce "https://cockpit-home.javiersc.com http://nixos.local:9090";

Symptom: Running systemctl status cockpit shows the service is dead.

Cause: Cockpit is socket-activated by default. It only starts when a connection is made to port 9090.

Solution: This is normal behavior. Check systemctl status cockpit.socket to ensure the listener is active.