Installing Containerlab on Ubuntu Server in Proxmox

Why Containerlab?

So far, all of my labs have been built with Cisco Modeling Labs. As much as I love working with Cisco IOS, the time has come to expand NickDoesLabs. Cisco Modeling Labs is a paid product, and Cisco’s Packet Tracer terms require written approval for uses such as creating videos or courseware outside Networking Academy.

For these reasons, I’m giving Containerlab a try. It’s free and open source, and I’ll be using the open-source FRRouting suite for my first lab. Other router images may have their own license terms.

Let’s get started.

The Environment

My homelab is simple. I have a Dell PowerEdge R710, which currently lives in my bedroom. That server runs Proxmox, which I use to virtualize the rest of my environment. Currently it has been running my Cisco Modeling Labs host. I’ve shut that down for now. I’ll be creating a new Ubuntu Server VM on Proxmox to host Containerlab.

Containerlab runs in a Linux environment. On Windows, you can use Windows Subsystem for Linux (WSL). I’ll cover WSL setup in a separate tutorial.

Video Walkthrough

Creating the VM

Here are the Proxmox settings I used for the Ubuntu Server VM on my Dell PowerEdge R710.

CPUHost
Sockets2
Cores per socket6
vCPUs12
Disk size150 GiB
Memory32,000 MiB
NUMAOn
Nested VirtualizationOn
QEMU Guest AgentOn
BallooningOff

Here is the confirmation screen from Proxmox:

Proxmox confirmation screen for the Ubuntu Server virtual machine.

Next, we need to configure Ubuntu.

Configuring the Ubuntu VM

With the Ubuntu Server ISO attached to the VM’s virtual CD/DVD drive, start the VM and open its console in Proxmox.

Ubuntu Server installer open in the Proxmox VM console.

Here you will configure the language, keyboard settings, and networking options for the Ubuntu installer.

After the network and package mirror screens, the installer prompts you to configure the virtual disk.

Ubuntu Server guided storage screen for selecting the virtual disk and LVM layout.

Since this is a virtual disk anyway, I will let the VM use the entire disk and set it up as an LVM volume group. I’m not enabling disk encryption here since it would require entering the passphrase every time the VM boots.

Next, the installer will ask you to confirm the storage configuration. I’m going to accept the default settings here:

Ubuntu Server storage summary showing the proposed partition and LVM layout.

After this the installer asks you to create your profile:

Ubuntu Server profile setup form for the server name, username, and password.

Next, you’ll be prompted to install OpenSSH server which you should do if you want to ssh into the VM. The installer also offered to install optional snaps which I declined.

The installer takes a few minutes now to download and install everything. Once it completes you will be prompted to reboot the VM. After rebooting you will see a message requesting that you remove the installation media and press Enter:

Ubuntu Server console prompt to remove the installation medium and press Enter.

To do this on Proxmox we will navigate to the VM’s hardware section, then double-click on the CD/DVD Drive. This opens the edit dialog box where you can click “Do not use any media” and press “OK”.

Proxmox VM Hardware tab showing the virtual CD/DVD drive.
Proxmox CD/DVD drive settings with the option to remove the mounted ISO.

Then return to the console and press Enter. Ubuntu Server will finish booting and bring you to a login prompt where you will need to enter the username and password you configured earlier.

Once logged in, you may see pending updates.

Ubuntu Server login message showing pending package updates.

To install the pending updates, run sudo apt update && sudo apt upgrade -y. Reboot the VM if Ubuntu reports that a restart is required.

Next I’ll use Putty and connect via SSH to the VM’s IP address on TCP port 22.

Ubuntu Server terminal output from installing OpenSSH Server.

At this point we are ready to install Containerlab.

Installing Containerlab

To install Containerlab we will run the command:

curl -sL https://containerlab.dev/setup | sudo -E bash -s "all"

This command pulls an installation script from containerlab’s website and executes it. It is the easiest method for installing Containerlab, but alternative options are available on containerlab.dev.

Once the script completes, in order to run docker commands without sudo in this shell, run:

newgrp docker

Run docker ps to check that Docker is running and your shell can access it. With Containerlab installed, the environment is ready for our first network lab.

Conclusion

Perfect! Installing Containerlab was easier than I expected. I was expecting to run into more roadblocks and glitches, but everything is working fine. I’m super excited to get more familiar with Containerlab and build some awesome labs in it.

Ready to build your first network? Continue to Build Your First Lab in Containerlab with FRRouting, where we’ll deploy three routers, configure OSPF, and verify connectivity.

Leave a Comment