> For the complete documentation index, see [llms.txt](https://docs.overleaf.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overleaf.com/on-premises/installation/podman.md). Agents can also search and read this documentation through its [MCP server](https://docs.overleaf.com/~gitbook/mcp).

# Podman

A step-by-step guide to running Overleaf Server Pro with rootless Podman on a clean RHEL-based installation (CentOS Stream, Rocky Linux, AlmaLinux, RHEL). SELinux remains enforcing throughout.

{% hint style="info" icon="flask" %}
Podman support is experimental and comes with limited support. It is only tested on RHEL 9+ with rootless Podman, Server Pro Sandboxed Compiles (`SIBLING_CONTAINERS_ENABLED=true`) and SELinux enforcing. Docker remains the recommended container runtime.&#x20;

If you have any feedback please reach out to [support+serverpro@overleaf.com](mailto:overleaf+serverpro@overleaf.com).&#x20;
{% endhint %}

In this guide we'll go through a manual setup instead of running `bin/podman-setup` ([docs](https://docs.overleaf.com/on-premises/installation/using-the-toolkit/4.-choose-community-edition-or-server-pro/podman.md)). Every Podman-specific step below matches a check or fix that the script performs.

### Overview

The `bin/podman-setup` script validates and auto-fixes a RHEL-based system for use with Overleaf Server Pro using rootless Podman, [Sandboxed Compiles](https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/server-pro-only-configuration/sandboxed-compiles.md), and SELinux enforcing. Running `bin/podman-setup` (dry-run) checks for issues; running `bin/podman-setup --apply` fixes them automatically.

This guide walks through those same steps manually.

### Prerequisites

#### Supported Operating Systems

We only officially support RHEL (Red Hat Enterprise Linux) 9 and later, but this guide *should* work with other RHEL-based distributions such as CentOS Stream, Rocky Linux and AlmaLinux.

{% hint style="info" %}
This guide will assume that SELinux is enabled and set to **Enforcing** mode.
{% endhint %}

#### Clean installation

This guide has been tested on a fresh installation, and assumes the host has:

* No Docker installation. Docker and the `podman-docker` shim both provide `/usr/bin/docker`, and the Toolkit treats the host as Podman whenever the `podman` command is available.
* No existing Podman configuration in `~/.config/containers/`.
* No existing Toolkit installation or Overleaf data. Moving an existing Docker-based instance to Podman is not covered.
* No custom SELinux policy for containers.

If your host differs, review each step before you apply it, and run `bin/podman-setup` to check the result.

Run every step as the non-root user that will own the rootless Podman setup. `bin/podman-setup` refuses to run as root.

{% stepper %}
{% step %}

### Install System Packages

Install all required packages:

```bash
sudo dnf install -y podman podman-docker git curl checkpolicy policycoreutils
```

#### **What each package is for**

| Package                           | Purpose                                         |
| --------------------------------- | ----------------------------------------------- |
| `podman`                          | Rootless container runtime                      |
| `podman-docker`                   | Provides `/usr/bin/docker` shim → Podman        |
| `git`                             | Clone the Overleaf Toolkit                      |
| `curl`                            | Download Docker Compose binary and socket tests |
| `checkpolicy` + `policycoreutils` | Build and load SELinux policy                   |

{% hint style="info" %}
You can suppress the Docker emulation message "*Emulate Docker CLI using podman*" by running the following command.

```bash
sudo touch /etc/containers/nodocker
```

{% endhint %}
{% endstep %}

{% step %}

### Configure Rootless Podman

Rootless Podman lets you run containers as a non-root user -- more secure, no privilege escalation needed.

#### Enable user lingering

This keeps the user's systemd session alive after logout, so Podman services keep running:

```bash
sudo loginctl enable-linger $USER
```

#### Start and enable the Podman socket

The Podman socket provides the Docker-compatible API that the Overleaf toolkit uses:

```bash
systemctl --user enable --now podman.socket
```

Verify it's running:

```bash
systemctl --user status podman.socket
```

Then check the socket responds. This should print `OK`:

{% code overflow="wrap" %}

```bash
curl -s --unix-socket "/run/user/$(id -u)/podman/podman.sock" http://localhost/_ping
```

{% endcode %}

{% hint style="info" %}
Socket access for Sandboxed Compiles -- when Overleaf compiles documents, the `www-data` user inside the `sharelatex` container connects to the Podman socket to spawn sibling compile containers.
{% endhint %}
{% endstep %}

{% step %}

### Install Docker Compose v2

The Overleaf Toolkit uses `docker compose` internally. Podman emulates the `docker` CLI via `podman-docker`, but we need the real Docker Compose v2 binary.

{% code overflow="wrap" %}

```bash
# Create the install and plugin directories
mkdir -p ~/.local/bin ~/.docker/cli-plugins

# Latest release for this CPU architecture, downloaded to a temporary directory
base_url="https://github.com/docker/compose/releases/latest/download"
binary="docker-compose-linux-$(uname -m)"
tmp="$(mktemp -d)"

# Download the binary and its published checksum
curl -fsSL "${base_url}/${binary}" -o "${tmp}/docker-compose"
curl -fsSL "${base_url}/${binary}.sha256" -o "${tmp}/docker-compose.sha256"

# Check the checksum, and only install the binary if it matches
echo "$(cut -d' ' -f1 "${tmp}/docker-compose.sha256")  ${tmp}/docker-compose" | sha256sum --check \
  && install -m 0755 "${tmp}/docker-compose" ~/.local/bin/docker-compose

# Remove the downloads
rm -rf "$tmp"

# Make the binary available as the `docker compose` plugin
ln -sf ~/.local/bin/docker-compose ~/.docker/cli-plugins/docker-compose
```

{% endcode %}

`sha256sum` should print `OK`. If it reports a mismatch, the binary is not installed; download it again.

Verify everyings installed correctly using:

```bash
docker-compose version
```

If you get `command not found`, you can try adding `~/.local/bin` to your `PATH`.

{% hint style="warning" %}
Do not use the [podman-compose](https://github.com/containers/podman-compose) implementation of the [Compose Spec](https://compose-spec.io/) as it's not currently compatible with how socket mounts work with Overleaf Server Pro.
{% endhint %}
{% endstep %}

{% step %}

### Configure Podman registries

The Toolkit's Compose files use short image names like `mongo` instead of `docker.io/library/mongo`. Podman's short-name mode prompts on a TTY by default -- but there's no TTY inside Compose, so the pull fails. To work around this we'll create an alias for the affected images:

{% code overflow="wrap" %}

```bash
conf_dir="$HOME/.config/containers/registries.conf.d"
mkdir -p "$conf_dir"

cat > "$conf_dir/overleaf-toolkit.conf" << 'EOF'
# overleaf-toolkit managed configuration

[aliases]
"mongo" = "docker.io/library/mongo"
"redis" = "docker.io/library/redis"
EOF
```

{% endcode %}
{% endstep %}

{% step %}

### Configure Podman Compose provider

Tell Podman to use the Docker Compose v2 binary we installed, and silence the warning about multiple providers. If `containers.conf` already exists, append the `[engine]` section:

```bash
mkdir -p ~/.config/containers

cat >> ~/.config/containers/containers.conf << EOF
[engine]
compose_warning_logs = false
compose_providers = ["$HOME/.docker/cli-plugins/docker-compose"]
EOF
```

{% hint style="info" %}
Without this, Podman may log warnings about detecting multiple Compose providers, this ensures the official Docker Compose v2 binary is always used.
{% endhint %}

Check that `docker compose` now reaches Docker Compose v2 through Podman:

```bash
docker compose version
```

{% endstep %}

{% step %}

### Clone and initialise the Toolkit

```bash
git clone https://github.com/overleaf/toolkit.git ~/overleaf-toolkit
cd ~/overleaf-toolkit
./bin/init
```

The `bin/init` command initializes three configuration files `overleaf.rc`, `variables.env` and `version`. These are the main server configuration files that allow you to customize how your server operates and how your users interact with your instance.

{% hint style="info" %}
This script will **not** overwrite any existing configuration files. It exits with an error if any of them already exist.
{% endhint %}

Run the remaining commands in this guide from the Toolkit directory.&#x20;

Then update the configuration for Server Pro, edit the `config/overleaf.rc` file and set

```bash
SERVER_PRO=true
OVERLEAF_PORT=8080
SIBLING_CONTAINERS_ENABLED=true
```

{% hint style="info" %}
On Linux, ports **below** 1024 are **privileged** -- binding to them normally requires root. As we're setting up rootless Podman, in this example, we've changed the `OVERLEAF_PORT` from **80** to **8080**.
{% endhint %}

Next, edit the `config/variables.env` file, uncomment `TEX_LIVE_DOCKER_IMAGE` and `ALL_TEX_LIVE_DOCKER_IMAGES`, and set them to the TeX Live images you want to use, for example:

```bash
TEX_LIVE_DOCKER_IMAGE=quay.io/sharelatex/texlive-full:2026.1
ALL_TEX_LIVE_DOCKER_IMAGES=quay.io/sharelatex/texlive-full:2026.1
```

`bin/up` exits with an error if `ALL_TEX_LIVE_DOCKER_IMAGES` is not set. You can find more information about configuring TeX Live images [here](https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/server-pro-only-configuration/sandboxed-compiles.md#changing-the-tex-live-image).
{% endstep %}

{% step %}

### Configure Toolkit for Podman

The Toolkit needs to know where the Podman socket is. These variables belong in `config/overleaf.rc` (the Toolkit `config/` directory), not in `config/variables.env` (the container environment).&#x20;

If `DOCKER_HOST` leaks into the container environment, `sharelatex` gets confused about which socket to use and the sibling containers will fail to create.

The socket path is computed from your user's UID. `config/overleaf.rc` already contains a `DOCKER_SOCKET_PATH` line, so replace it rather than adding a second one:

```bash
SOCK="/run/user/$(id -u)/podman/podman.sock"

echo "DOCKER_HOST=unix://${SOCK}" >> config/overleaf.rc
echo "DOCKER_SOCKET_PATH=${SOCK}" >> config/overleaf.rc
```

{% hint style="info" %}
**Why two variables?**

* `DOCKER_HOST` tells the Toolkit scripts where to connect
* `DOCKER_SOCKET_PATH` is used as the bind mount source in the sibling containers Compose file.
  {% endhint %}
  {% endstep %}

{% step %}

### Authenticate with quay.io

The Overleaf Server Pro image is hosted on quay.io behind authentication. To log in you'll need to use the username and password you were provided during onboarding.

```bash
podman login quay.io
```

{% endstep %}

{% step %}

### Create the SELinux policy

When the `www-data` user inside the `sharelatex` container connects to the Podman socket to spawn sibling containers, SELinux checks two things:

1. **The socket file** — can the container write to the socket?
2. **The socket process** — can the container connect through the socket?

The default container type, `container_t`, is allowed neither. The Toolkit's policy module defines a `sharelatex_t` type for the `sharelatex` container, and grants only that type access to the socket.

The socket file and the socket process have different SELinux contexts:

| Check                                                   | Context               | Required permission                                                                                                                                               |
| ------------------------------------------------------- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Socket **file** at `/run/user/<uid>/podman/podman.sock` | `user_tmp_t` (tmpfs)  | <p><code>container\_t → user\_tmp\_t:sock\_file write</code><br><br><code>container\_t → user\_tmp\_t:sock\_file getattr</code><br></p>                           |
| Socket **process** (podman.socket service)              | `container_runtime_t` | <p><code>sharelatex\_t → container\_runtime\_t:unix\_stream\_socket connectto</code><br><code>sharelatex\_t → container\_runtime\_t:fifo\_file setattr</code></p> |

The `sharelatex` container also needs `sharelatex_t → self:netlink_audit_socket nlmsg_relay`.

The Toolkit ships a policy module at `lib/podman_socket_clsi.te`. Copy it and install it:

```bash
mkdir -p ~/.overleaf/selinux
cp lib/podman_socket_clsi.te ~/.overleaf/selinux/

checkmodule -M -m -o ~/.overleaf/selinux/podman_socket_clsi.mod \
  ~/.overleaf/selinux/podman_socket_clsi.te
semodule_package -o ~/.overleaf/selinux/podman_socket_clsi.pp \
  -m ~/.overleaf/selinux/podman_socket_clsi.mod
sudo semodule -i ~/.overleaf/selinux/podman_socket_clsi.pp
```

Verify it's loaded:

```bash
sudo semodule -l | grep podman_socket_clsi
```

The policy module `podman_socket_clsi` contains three allow rules:

```bash
allow sharelatex_t user_tmp_t:sock_file { write getattr };
allow sharelatex_t container_runtime_t:unix_stream_socket connectto;
allow sharelatex_t container_runtime_t:fifo_file setattr;
allow sharelatex_t self:netlink_audit_socket nlmsg_relay;
```

Loading the module doesn't change anything on its own. Set `SELINUX_MODE=managed` in `config/overleaf.rc` so the Toolkit starts the `sharelatex` container with the `sharelatex_t` type:

```bash
echo "SELINUX_MODE=managed" >> config/overleaf.rc
```

`SELINUX_MODE` accepts these values:

| `SELINUX_MODE`      | Effect on the `sharelatex` container                                                                                                             |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `managed`           | Runs as `sharelatex_t`, from the `podman_socket_clsi` module. Recommended.                                                                       |
| `custom`            | Runs as the type set in `SELINUX_LABEL`. The type must exist in the loaded policy and include the rules above.                                   |
| `disable` (default) | Runs with SELinux confinement disabled (`label=disable`). Compiles work without the policy module, but SELinux no longer confines the container. |
| `none`              | No SELinux option is set, so the container runs as `container_t` and can't reach the Podman socket.                                              |

Load the module before setting `SELINUX_MODE=managed`. If `sharelatex_t` doesn't exist in the loaded policy, the container starts without the label and compiles fail.
{% endstep %}

{% step %}

### Install the Seccomp profile

The Seccomp (Secure Computing) profile controls what syscalls spawned sibling containers can use. It ships inside the Server Pro image at `/overleaf/services/clsi/seccomp/clsi-profile.json`.

{% hint style="info" %}
Unlike Docker, Podman interprets the default Seccomp profile as a literal file path rather than a built-in value. For this reason, the `SECCOMP_PROFILE` environment variable must be set to the path of the Seccomp profile file on the host machine. This is **not** required when using Docker.
{% endhint %}

`bin/up` and `bin/upgrade` do this automatically. If the profile for the current version is missing, they extract it from the Server Pro image to `config/seccomp/<version>/clsi-profile.json` and set `SECCOMP_PROFILE` in `config/variables.env` to that path. If `SECCOMP_PROFILE` points anywhere else, `bin/up` replaces it.

To extract the profile manually instead:

```bash
VERSION="$(head -n 1 config/version)"
IMAGE="quay.io/sharelatex/sharelatex-pro:${VERSION}"
DEST="$PWD/config/seccomp/${VERSION}/clsi-profile.json"

podman pull "$IMAGE"
mkdir -p "$(dirname "$DEST")"
cid="$(podman create "$IMAGE")"
podman cp "${cid}:/overleaf/services/clsi/seccomp/clsi-profile.json" "$DEST"
podman rm "$cid"

echo "SECCOMP_PROFILE=${DEST}" >> config/variables.env
```

{% endstep %}

{% step %}

### Set data directory permissions

MongoDB and Redis data directories must be writable by the mapped container UIDs. The script checks and fixes this automatically using `podman unshare`:

```bash
# Overleaf (UID 33)
mkdir -p data/overleaf
podman unshare chown -R 33:33 data/overleaf

# MongoDB (UID 999)
mkdir -p data/mongo
podman unshare chown -R 999:999 data/mongo

# Redis (UID 999)
mkdir -p data/redis
podman unshare chown -R 999:999 data/redis

# git-bridge (UID 1000), only if GIT_BRIDGE_ENABLED=true
mkdir -p data/git-bridge
podman unshare chown -R 1000:1000 data/git-bridge
```

If you changed any of the `*_DATA_PATH` settings in `config/overleaf.rc`, use your paths instead.
{% endstep %}

{% step %}

### Verify the settings

Even though you've manually applied the settings, it's still possible (and recommended) to run the `bin/podman-setup` script to verify that the above changes have been applied correctly. If you've missed a step or made a typo the script should pick it up and log it as a warning/failure.

If you run `bin/podman-setup` before starting your instance for the first time, it reports the warning `container → socket skipped (sharelatex not running)` and exits with code `1`. This is expected: the script can only test the socket from inside the `sharelatex` container once it's running.
{% endstep %}

{% step %}

### Start your instance

Once you've verified the required changes, you can run the `bin/up -d` script to start your instance for the first time. During this process you'll see the MongoDB, Redis, Server Pro and TeX Live images pulled in turn.

Once it's running, run `bin/podman-setup` and `bin/doctor` again. Both should report `container → socket: OK`, which confirms the `sharelatex` container can reach the Podman socket.

When complete, please resume the setup by performing the [post-installation](https://docs.overleaf.com/on-premises/installation/using-the-toolkit/6.-post-installation-tasks.md) tasks to create your first account.
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.overleaf.com/on-premises/installation/podman.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
