Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions docs/gemstones/containers/podman.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: Podman
author: Neel Chauhan
contributors: Steven Spencer
date: 2024-03-07
tags:
- docker
- podman
---

# Introduction

[Podman](https://podman.io/) is a Docker-compatible alternative container runtime that, unlike Docker, is included in the Rocky Linux repositories and can run containers as a `systemd` service.

## Install Podman

Use the `dnf` utility to install Podman:

```
dnf install podman
```

## Adding a container

Let us run a [Nextcloud](https://nextcloud.com/) self-hosted cloud platform as an example:

```
podman run -d -p 8080:80 nextcloud
```

You will receive a prompt to select the container registry to download from. We will use `docker.io/library/nextcloud:latest` in our example.

Once you have downloaded the Nextcloud container, it will run.

Enter **ip_address:8080** in your web browser (assuming you opened the port in `firewalld`) and set up Nextcloud:

![Nextcloud in container](../images/podman_nextcloud.png)

## Running containers as `systemd` services

As mentioned earlier, you can run Podman containers as `systemd` services. Let us now do it with Nextcloud. Run:

```bash
podman ps
``

You will get a list of running containers:

```bash
04f7553f431a docker.io/library/nextcloud:latest apache2-foregroun... 5 minutes ago Up 5 minutes 0.0.0.0:8080->80/tcp compassionate_meninsky
```

To make a `systemd` container and enable it on reboot, run:

```bash
podman generate systemd --name compassionate_meninsky > /usr/lib/systemd/system/nextcloud.service
systemctl enable nextcloud
```

When your system reboots, Nextcloud will restart in Podman.
Binary file added docs/gemstones/images/podman_nextcloud.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.