How to Install and Use Toolbox on Fedora

Install the toolbox package via DNF and run toolbox create to launch a new Fedora container environment.

When the host is not enough

You are working on a project that requires a specific version of a library, but your host system is locked to a stable release. You need to compile a kernel module, but you do not want to risk breaking your boot process. You want to test a new development tool, but you refuse to clutter your host package database with dependencies you might never use again. You open the terminal and hesitate. Installing random packages can drift your system. Mixing package managers can leave you with a broken upgrade path. You need a safe workspace where you can install anything, break anything, and delete it all without touching the host. That is what Toolbox gives you.

What Toolbox actually does

Toolbox creates a lightweight container that shares the host's kernel but provides a separate filesystem and package database. Think of it as a portable workbench bolted onto your desk. The workbench has its own tools and wood scraps. If you saw through the workbench, your desk stays intact. Toolbox containers run as your user, not root, which keeps them safe and fast. They integrate with your user session, so you can access your home directory and display server directly.

This is different from a virtual machine. A virtual machine emulates an entire computer, including the kernel and hardware. It consumes gigabytes of RAM and takes time to boot. Toolbox containers share the host kernel. They start in seconds and use only the memory they need. This is also different from Docker. Docker is designed for shipping applications to production. It isolates the container from the host by default. Toolbox is designed for interactive development. It shares your user identity, your network, and your display. You can clone private repositories, sign commits with GPG, and launch GUI applications without configuring forwarding rules.

Toolbox uses Podman as the backend. Podman is a daemonless container engine. It runs containers as your user and does not require a background service with root privileges. Fedora ships with Podman support enabled by default. Toolbox is a wrapper around Podman that sets up the container with the right options for development. You can use Podman commands directly if you know the container name, but Toolbox handles the configuration for you.

Run dnf upgrade --refresh before creating a container. A fresh host ensures the base image pulls correctly and matches your system libraries.

Install and create the container

Here is how to install the toolbox package and prepare your system.

sudo dnf install toolbox
# WHY: dnf pulls the toolbox package and its dependencies.
# WHY: This installs the CLI tool that manages the container lifecycle.
# WHY: Podman is installed automatically if it is not present.

The toolbox package is small. It installs the command-line tool and the necessary configuration files. Once installed, you can create a container.

Here is how to create a fresh container environment.

toolbox create
# WHY: Creates a container named 'fedora-toolbox' by default.
# WHY: Pulls the base image matching your host Fedora release.
# WHY: Sets up the container filesystem and user mapping.
# WHY: The container shares your user ID and group IDs.

The --image flag defaults to the current Fedora version if omitted. If you need a different version, you can pass --image fedora:40 or --image fedora:latest. The container name defaults to fedora-toolbox-<version>. You can specify a custom name with --container my-project.

Here is how to step into the container and start working.

toolbox enter
# WHY: Starts the container and drops you into a shell inside it.
# WHY: Your home directory is mounted read-write so your files are available.
# WHY: The prompt changes to show you are inside the container.

Once inside, you have a full Fedora environment. You can run dnf install without sudo. The container runs as your user, so you have full control over the container's filesystem. Your host packages are not visible inside the container. The container has its own package database. You can install development tools, compilers, and libraries without affecting the host.

Delete the container and start over if the build fails. Containers are cheap. Your host is not.

Verify the environment

Run these commands to confirm the container is set up correctly.

cat /etc/os-release | grep PRETTY_NAME
# WHY: Confirms the container is running the expected Fedora release.
whoami
# WHY: Verifies you are running as your user, not root.
id
# WHY: Shows your user ID and group IDs match the host.
ls -l /home
# WHY: Checks that your home directory is mounted correctly.

The output of cat /etc/os-release should show the Fedora version. The output of whoami should show your username. The output of id should show your user ID and group IDs. The output of ls -l /home should show your home directory is a bind mount. If the user IDs do not match, your files will have the wrong permissions inside the container. This is rare on Fedora because Toolbox sets up the user mapping automatically.

Check the user ID inside the container. If the IDs mismatch, your files will have the wrong permissions.

Manage the container lifecycle

Toolbox provides commands to manage the container. You can list containers, remove them, and run commands without entering the shell.

Here is how to list all toolbox containers.

toolbox list
# WHY: Shows all active toolbox containers and their states.
# WHY: Displays the container name, image, and creation date.

Here is how to remove a container.

toolbox rm
# WHY: Removes the default container and frees disk space.
# WHY: Asks for confirmation unless you pass --force.
# WHY: Deletes the container filesystem and all installed packages.

Here is how to run a single command inside the container.

toolbox run dnf install gcc
# WHY: Runs the command inside the container without dropping to a shell.
# WHY: Useful for scripting or one-off package installs.
# WHY: The container starts, runs the command, and exits.

Use toolbox run when you need to execute a command inside the container from a script or a CI pipeline. It avoids the overhead of entering and exiting the shell. You can also use toolbox upgrade to update the packages inside the container. This keeps the container's base image up to date without affecting the host.

Read the journal before restarting services. journalctl -xe tells you why Podman refused to start.

Common pitfalls and errors

Toolbox is robust, but you will encounter errors if the environment is misconfigured. Here are the most common issues and how to fix them.

If you see Error: cannot connect to Podman socket: connection refused, your user is not in the podman group or the service is not running. Fedora enables user namespaces by default, so this is rare. Run systemctl --user enable --now podman to start the user service. Check systemctl --user status podman to verify it is running.

If you see Error: image not found, the registry might be down or your network is blocking it. Toolbox pulls from registry.fedoraproject.org by default. Check your network connection. You can specify a different registry with --registry.

If you see Error: permission denied when accessing /dev, your user namespaces might be disabled. Fedora enables user namespaces by default. Check /proc/sys/user/max_user_namespaces. If the value is zero, user namespaces are disabled. This is unlikely on a default Fedora install.

If you see SELinux denials, Toolbox handles SELinux contexts automatically. The container runs with the correct labels. If you mount a custom volume, you might need to add the :z or :Z suffix to the mount option. This tells SELinux to relabel the content. Toolbox does not require this for the default mounts.

If the boot menu is gone, GRUB rescue is your friend, not your enemy.

Choose the right tool

Use Toolbox when you need a disposable environment that matches your host release and integrates with your user session. Use Distrobox when you need to run containers on distributions that do not support Podman natively, or when you want a unified CLI for multiple container engines. Use a Virtual Machine when you need to test a different kernel version or require full hardware isolation. Use the host system when you are installing stable packages via dnf that do not conflict with existing software. Stay on the host if you only need a single development tool that is available in the Fedora repositories.

Trust the package manager. Manual file edits drift, snapshots stay.

Where to go next