Skip to content

Setting up an LXC Container with Docker and NFS on Proxmox

Published: at 10:32 PM

futuristic-container.png I recently switched to using almost all Proxmox LXC containers with docker and NFS for all my homelab services. These are the steps I follow to set one up.

Table of contents

Open Table of contents

Set up LXC container with Docker

  1. Create LXC container with this helper script.
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/docker.sh)"

I just use all the default settings. No Portainer, no docker-compose, nothing…

  1. Make new user “sean”
adduser sean
  1. Add user to docker and sudo groups
usermod -aG docker sean
usermod -aG sudo sean
  1. Make docker folder and link it to root directory
mkdir /home/sean/docker
ln -s /home/sean/docker /docker
  1. Add ssh key to ~/.ssh/authorized_keys
  2. In Proxmox, set static IP and DNS
  3. Ensure docker is able to pull images by running the following
docker run hello-world
docker image rm -f hello-world

Setting up NFS

In order to use NFS inside LXC, you need to have a privileged container. Follow these steps to convert your container to privileged in Proxmox.

  1. Shut down the container if running
  2. Backup container
  3. Restore container but change Privilege Level to Privileged
  4. Under Options > Features, check the NFS feature
  5. Boot it up
  6. Install nfs-common
apt update && apt install -y nfs-common
  1. Update /etc/fstab
  2. Create mountpoints
mkdir /mnt/share1 /mnt/share2 /mnt/share3
  1. Mount all mountpoints
sudo mount -va

Previous Post
Removing Closed Captions from M3U8 Streams w/ FFmpeg
Next Post
Test Post