# Podman Rootless Setup Set up Gordon with Podman in rootless mode for enhanced security. ## What You'll Learn - Installing Podman for rootless containers - Configuring firewall port forwarding - Running Gordon as a user service - Troubleshooting common issues ## Prerequisites - Ubuntu 24.04 LTS or Debian 13 - VPS with root access (for initial setup) - Domain pointing to your VPS ## Why Rootless? Rootless containers run without root privileges, providing: - **Security**: Container escapes don't grant root access - **Isolation**: Each user has separate container namespace - **Simplicity**: No Docker daemon required ## Steps ### 1. System Preparation ```bash # Update system sudo apt update && sudo apt upgrade -y # Install Podman and firewalld sudo apt install -y podman firewalld # Enable firewalld sudo systemctl enable --now firewalld ``` ### 2. Configure User Namespaces ```bash # Enable user namespaces echo 'user.max_user_namespaces=28633' | sudo tee -a /etc/sysctl.conf sudo sysctl -p # Setup subuid/subgid for your user sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 $USER ``` ### 3. Configure Firewall Port Forwarding Rootless containers can't bind to ports below 1024. Forward 80/443 to high ports: ```bash # Allow HTTP/HTTPS traffic sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --permanent --add-service=https # Forward privileged ports to unprivileged sudo firewall-cmd --permanent --add-forward-port=port=80:proto=tcp:toport=8080 sudo firewall-cmd --permanent --add-forward-port=port=443:proto=tcp:toport=8443 # Apply changes sudo firewall-cmd --reload # Verify sudo firewall-cmd --list-all ``` ### 4. Enable Podman Socket ```bash # Enable user Podman socket systemctl --user enable --now podman.socket # Verify systemctl --user status podman.socket ``` ### 5. Configure Registry Access Allow pushing to localhost registry without TLS: ```bash mkdir -p ~/.config/containers cat > ~/.config/containers/registries.conf < ~/.config/systemd/user/gordon.service <