Setting Up Ubuntu 24.04 Server on Proxmox with Docker and Portainer

As part of my ongoing journey to expand my homelab and learn more about Docker and containerization, I recently installed Ubuntu 24.04 Server on VLAN 30 of my Proxmox environment. Here’s how I set it up, the tools I installed, and what I learned in the process.

Why This Setup?

I wanted to explore Docker and its potential for running security tools that can monitor my homelab. To do this, I created a virtual machine (VM) specifically for this purpose.

VM Specifications

Here are the details of the virtual machine I configured:

  • Name: UbntSrv
  • RAM: 4 GB
  • Storage: 100 GB
  • VMID: 3001

This configuration is more than sufficient for running Docker, Portainer, and a few containers.

Installation and Configuration Steps

1. Installing Docker

To simplify the process, I installed Docker directly from the Ubuntu installation menu. This ensured I had the Docker runtime ready to go right after the operating system installation.

2. Network Configuration

After the installation, I ran the ip a command to verify the IP address of the VM. It returned an IP of 10.10.30.100, which is within the range I set for VLAN 30 in my homelab.

3. Updating the System

Keeping the system up-to-date is crucial for security and stability. I ran the following command to update all packages:

sudo apt update && sudo apt upgrade -y

4. Remote Access via SSH

To streamline further configurations, I enabled OpenSSH-Server and used SSH to connect to the server from a Kali Linux instance in my homelab. This allowed me to manage the VM without having to access its console directly.

5. Installing Portainer

Portainer is a lightweight management UI that makes it easy to manage Docker environments. Following the official documentation, I ran the following command to install Portainer:

docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data portainer/portainer-ce:2.21.5

Once the command completed, I confirmed the installation by running:

sudo docker ps

This command displayed the running containers, and Portainer was successfully listed.

6. Accessing the Portainer Web Interface

I opened a web browser and navigated to: https://10.10.30.100:9443
The secure Portainer dashboard loaded perfectly, ready for use.

Credentials for Portainer

  • Username: admin
  • Password: I set a unique password since Portainer requires a 12-character password for security.

What’s Next?

With Docker and Portainer up and running, my next step is to explore and deploy security tools within Docker containers. These tools will help me monitor and analyze the traffic and activity within my homelab. I’m also looking forward to experimenting with different containerized applications to expand my understanding of Docker.

Key Takeaways

  • Setting up Ubuntu Server on Proxmox is straightforward with VLANs.
  • Docker and Portainer provide a powerful combination for managing containers efficiently.
  • Always update your system and change default credentials for better security.

This was a fun and educational project that brought me one step closer to mastering Docker and containerization. If you have questions or want to try something similar in your homelab, feel free to reach out or share your experiences!

Leave a comment