How to Access Containers

Methods for accessing LXC containers and running commands.

When to use

  • Checking service status
  • Running maintenance commands
  • Debugging issues
  • Viewing logs

Prerequisites

  • Access to Proxmox host
  • Know the CT ID of the container

Methods

1. Execute single command (from Proxmox host)

# Run command in container
pct exec <CT_ID> -- <command>
 
# Examples
pct exec 120 -- docker ps
pct exec 120 -- ls -la /data
pct exec 120 -- systemctl status docker

2. Interactive shell (from Proxmox host)

# Access container shell
pct exec <CT_ID> -- bash
 
# Or using enter
pct enter <CT_ID>

3. SSH directly (if SSH server installed)

# SSH to container
ssh root@<container-ip>
 
# Example
ssh root@192.168.144.61

Common Commands

Container management

# List all containers
pct list
 
# Start/Stop/Restart
pct start <CT_ID>
pct stop <CT_ID>
pct restart <CT_ID>
 
# View container config
cat /etc/pve/lxc/<CT_ID>.conf
 
# View container status
pct status <CT_ID>

Docker commands (inside container)

# List running containers
docker ps
 
# List all containers (including stopped)
docker ps -a
 
# View logs
docker logs <container-name>
 
# Execute command in container
docker exec -it <container-name> bash

Docker Compose commands

# Navigate to service directory
cd /opt/homelab-docker/<service>
 
# View status
docker compose ps
 
# View logs
docker compose logs -f
 
# Restart service
docker compose restart
 
# Stop service
docker compose down
 
# Start service
docker compose up -d
 
# Pull new images
docker compose pull

Quick Reference: Common CT IDs

CT IDService
120n8n
121Syncthing
122Planka
123Grav
124AI Services
125Jellyfin
126Cloudflared
127Lanproxy
128WordPress DB
129WordPress jokegoudriaan
130WordPress kledingruil
131WordPress pgh
108Immich (VM)
114Home Assistant (VM)

Quick Reference: Common IP Addresses

IPService
192.168.144.31Lanproxy
192.168.144.32Cloudflared
192.168.144.41WordPress DB
192.168.144.60Planka
192.168.144.61n8n
192.168.144.62AI Services
192.168.144.63Syncthing
192.168.144.70WordPress jokegoudriaan
192.168.144.71WordPress kledingruil
192.168.144.72Grav
192.168.144.73WordPress pgh
192.168.144.100Jellyfin
192.168.144.110Immich (VM)
192.168.144.120Home Assistant (VM)