> ## Content Index
> Fetch the complete content index at: https://linuxhandbook.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Linux CTF Challenges
- URL: https://linuxhandbook.com/ctf/
- Published: 2026-09-30T11:26:04.000Z
- Updated: 2026-09-30T12:43:30.000Z
- Description: Free capture-the-flag games that test your Linux command line skills. No account needed. The levels run in Docker on your own computer.
- Author: Abhishek Prakash
- Tags: CTF, #folders-col, #group-ctf-games, #group-ctf-help

Think you know your way around the Linux command line? Prove it.

A capture-the-flag game, or CTF, hides a secret string somewhere in a system and challenges you to find it. It's a long-standing tradition in the security world. 

Here, the idea is simpler: each game is a set of small Linux puzzles, and you solve them with the same commands you use every day.

There's no browser-based hand-holding and no multiple choice. You get a shell, a hint and a hidden flag. Find the flag, submit it and move on to the next level.

The games are free, and you don't need an account to play.

## The games

Pick one and start. Each game page has its own quick start, so you can jump straight in.

📋

More games are on the way. Some will be for Linux Handbook members only. Perfect time to get a membership.

## How it works

Every level is a small Linux system that runs in a Docker container on your own computer. You get a real shell to poke around in, and it stays fast no matter how many people are playing.

A small program, `play.py`, handles everything else. It downloads one level at a time, starts it, opens a shell for you and sends your flags to the Linux Handbook server. The only things that leave your computer are your handle and the flags you submit.

![How the CTF works on LHB](https://linuxhandbook.com/content/images/2026/09/how-it-works-dark.svg)

## What you need

You need Linux or macOS with Docker installed and running. On Windows, play inside WSL 2.

If you don't have Docker yet, follow the [official install guide](https://docs.docker.com/engine/install/?ref=linuxhandbook.com).

```bash
sudo apt install docker.io

```

You also need Python 3.7 or newer. It's already there on most Linux distributions, and the game needs nothing beyond Python's standard library.

## Get the game

Download `play.py` :

```bash
curl -fsSLO https://ctf.linuxhandbook.com/play.py

```

And then run it:

```
python3 play.py
```

On the first run, you pick a handle. That's the name shown on the leaderboards. Then choose a game from the menu.

If Docker needs root on your system, use `sudo python3 play.py`. Or add yourself to the `docker` group so you don't need `sudo`:

```bash
sudo usermod -aG docker $USER

```

Log out and back in for the group change to apply.

## How to play

Every game works the same way. Choose it from the menu, then type `play` to enter the level. Your first command inside should be:

```bash
cat hint.txt

```

The hint is a riddle. Every word in it matters. Flags look like `LHB{...}`. When you find one, copy it, type `exit` to leave the level and submit it:

```
submit LHB{...}

```

These are the commands you can use at the game prompt:

| Command         | What it does                                          |
| --------------- | ----------------------------------------------------- |
| play            | Open a shell inside the level. Type exit to come back |
| submit LHB{...} | Submit the flag for this level                        |
| leaderboard     | Top 10 for this game                                  |
| restart         | Throw the level away and start it fresh               |
| menu            | Back to the list of games                             |
| quit            | Leave. Your progress is saved                         |

You play the levels in order, and each one gives its points once. Quit whenever you like. Run `python3 play.py` again later and you continue from the same level.

## Your handle

There's no sign-up. The first time you play, `play.py` creates a random key for your computer and saves it in `~/.ctf_user`. The server ties your handle to that key, so nobody else can play as you.

The catch is that your handle lives on that one computer. Lose the file or switch machines, and the handle stays behind. If you have a free Linux Handbook account, [link your handle to it](https://linuxhandbook.com/ctf-link/) and you can play from anywhere.

## Play fair

The levels run on your computer, and the flags are inside them. So yes, you could [dig the flags out of the Docker images](https://linuxhandbook.com/docker-inspect-command/) instead of solving anything.

I can't stop you, but you'd only be cheating yourself. The point is to learn something, and the fun is in that moment when the flag finally shows up in your terminal.

Please don't share flags or full solutions publicly. Talking about approaches is fine.

## FAQs

#### Is it free?

Most CTF games are. This will be mentioned on the game page.

#### Is it safe to run on my computer?

The levels run inside Docker containers, not on your system directly, and they're removed once you solve them. `play.py` is a single Python file you can read on [GitHub](https://github.com/linuxhandbook/ctf?ref=linuxhandbook.com) before running it. 

#### Can I play on Windows?

Yes, inside WSL 2 with Docker available there. Native Windows isn't supported.

#### I'm stuck. Where are the solutions?

There are no published walkthroughs, and that's on purpose. Read the hint again, then look up the commands it points you toward. Each game page links to tutorials that cover the skills it tests. So that could give you some hint as well. If nothing works and you really want to know, just send us a message.

#### ****A level seems broken.**

Type `restart` to reset it. If it's still broken, [open an issue on GitHub](https://github.com/linuxhandbook/ctf/issues?ref=linuxhandbook.com) and tell me which level and what you saw.

#### What do you store about me?

Your handle, a hash to identify your handle and machine, and which levels you solved and when. If you link a Linux Handbook account, also your member ID and whether your membership is paid. Your email never reach the CTF server and there is no password anywhere.

#### How do I start over?

Run `python3 play.py -r`. If your handle isn't linked to a Linux Handbook account, this gives it up for good. Your handle and score stay on the leaderboard.

#### How do I clean up afterwards?

Solved levels are removed automatically. To delete any leftover images, run `docker rmi $(docker images -q ghcr.io/linuxhandbook/ctf)`

#### How do I delete my handle and scores completely?

Run `python3 play.py --delete-me` and it will delete your handle and the scores associated with it. Your username and score is removed from the leaderboard as well. This is permanent and cannot be reversed.

Enjoy capturing the flags 🎏