Podman is a daemonless container engine for developing, managing, and running containers. It offers a more secure alternative to Docker by running containers as non-root users. In this guide, we will walk you through the steps to install Podman from source on Ubuntu. Whether you are deploying it on a local server or using a Windows VPS UK, this tutorial covers everything you need to know.
Step 1: Update Your System
Before installing Podman, ensure your system is up to date. Run the following commands:
sudo apt update && sudo apt upgrade -y
Keeping your system updated is crucial for security and performance, whether you're setting it up locally or on a VPS Windows Servers platform.
Step 2: Install Required Dependencies
Podman requires several packages and libraries to build from source. Install the necessary dependencies with:
sudo apt install -y \
golang-go \
make \
gcc \
btrfs-progs \
libseccomp-dev \
libassuan-dev \
libgpgme-dev \
pkg-config \
libdevmapper-dev \
libglib2.0-dev \
gpgme \
git \
libostree-dev
Step 3: Set Up Go Environment
Podman is written in Go, so you need to configure the Go environment. Set up the Go workspace with the following commands:
mkdir -p ~/go/src/github.com/containers
export GOPATH=~/go
export PATH=$GOPATH/bin:$PATH
You can add the above lines to your ~/.bashrc
or ~/.zshrc
file to make these changes permanent.
Step 4: Clone the Podman Repository
Now, clone the Podman repository from GitHub into your Go workspace:
cd ~/go/src/github.com/containers
git clone https://github.com/containers/podman.git
cd podman
Step 5: Build Podman
Before building Podman, ensure you have all the required dependencies. You can install them using the following command:
make install.tools
Once the tools are installed, build Podman by running:
make
Step 6: Install Podman
After successfully building Podman, install it by running:
sudo make install
Step 7: Verify Podman Installation
To verify that Podman has been installed correctly, check the version:
podman --version
You should see the installed version of Podman displayed in the terminal.
Step 8: Test Podman
To test Podman, you can run a simple container using:
podman run --rm hello-world
This will pull the hello-world
image from the container registry and run it.