GuidesNetwork and VPNWi-Fi logins with FreeRADIUS

Run a RADIUS server with FreeRADIUS and rootless Docker

FreeRADIUS on Debian 13 in rootless Docker under a user of its own, so that everyone logs in to Wi-Fi with WPA2 or WPA3 Enterprise, VPNs and network devices with their own user name and password, checked against certificates you make yourself.

Tested on Docker steps follow the tested rootless Docker base guide on Debian 13 with Docker Engine 29.10.1, Compose 5.8.1 and rootlesskit 3.3.0; the app version and app-specific behaviour are from the tested Podman guide on a Melonslab server. Not re-tested end to end under Docker. Updated November 28, 2026

Recommended server for this guide

SSD RAID 1 · ECC DDR4 · 10 Gbit

VC-P Alloy · 2 vCPU · 8 GB Memory · 60 GB Storage

Month to month, no lock-in 7-day money-back guarantee

€8.99/mo

Deploy now

Run this guide on Melonslab

We ran every step below on our own server. For this workload we recommend VC-P Alloy at €8.99/mo. Order it, pick Debian 13, and follow the guide.

  1. 1. Order the server. Use the button below to order the recommended plan. Choose Debian 13 when the installer asks for an operating system.
  2. 2. Add IPv4 if needed. Add it on the order form when the guide publishes a service on the internet. It is a paid add-on, not included in the plan.
  3. 3. Connect over SSH. Log in as root with the address and credentials from your order, then run the commands below.
  4. 4. Follow the verified steps. Every command in this guide was run on a Melonslab server before it was published.
Deploy now
On this page

What you will set up

A RADIUS server checks logins for other devices. Wi-Fi access points use it for WPA2 and WPA3 Enterprise, where everyone has their own user name and password instead of one shared Wi-Fi password. Many VPN servers, firewalls and switches can use it too. When someone leaves, you remove their line, and their login stops working everywhere.

FreeRADIUS is the most widely used open-source RADIUS server. This Docker version follows the tested rootless Docker base guide on Debian 13. Here it runs as a Compose service under a user of its own called radius, with certificates you make yourself, so that devices can check they are talking to your server before they send a password. The results below come from the tested Podman guide on a Melonslab server and were not measured again under Docker.

In that test on a Melonslab server with Debian 13:

  • A Linux client at another address logged in with PEAP and MSCHAPv2, the method Wi-Fi uses, with eapol_test, the test tool from wpa_supplicant, the Wi-Fi client in Linux and Android. It checked the server's certificate against our own CA, and refused to log in when given a different CA.
  • Logins with a password were accepted, a wrong password was rejected, and a wrong shared secret, or an address not on the list, got no answer.
  • The records the client sent when it connected were saved, in a file for each device.
  • A renewed server certificate worked without any change on the client, and everything came back by itself after a reboot.

In that test, FreeRADIUS used about 45 MB of memory. The steps for phones, laptops and access points follow the vendors' own documentation.

Before you start

You need:

  • a server set up as in the Docker guide, with ufw from the security guide. FreeRADIUS does not need Caddy;
  • the public IP address of each device that will send logins to the server, such as your office's address for its access points. Devices behind the same router all send from the router's address.

The examples use 203.0.113.10 for your server, 198.51.100.20 for your office, and radius.example.com as the server's name in its certificate. The name does not need a DNS record. Replace them throughout.

RADIUS was designed for local networks. With the Wi-Fi method in this guide, the password travels inside an encrypted connection from the device all the way to the server, but other details, such as the user name, are protected only by the shared secret. That is why this guide lets only your office's address reach the server, and uses a long random secret. For more protection, or if your office's address changes, connect the office to the server with WireGuard, and send RADIUS through the tunnel.

1. Allow your devices

As root, let only your office's address reach the two RADIUS ports, 1812 for logins and 1813 for accounting:

ufw allow from 198.51.100.20 to any port 1812:1813 proto udp

Give the same rule once for each address the logins come from.

2. Create the user

useradd -m -s /bin/bash radius
loginctl enable-linger radius
uid=$(id -u radius)

The uid is looked up so the commands below work for any user. Keep it in this shell. Everything from now on runs as radius.

3. Copy the settings out of the image

FreeRADIUS keeps its settings in its image. Copy out the two parts you change, the certificate templates and the settings for EAP, the methods Wi-Fi uses:

mkdir -p /home/radius/radius
cd /home/radius/radius
runuser -u radius -- env HOME=/home/radius XDG_RUNTIME_DIR=/run/user/$uid \
  DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
  bash -lc 'cd /home/radius/radius && \
    docker create --name radius-tmp docker.io/freeradius/freeradius-server:latest-3.2 && \
    docker cp radius-tmp:/etc/freeradius/certs ./certs && \
    docker cp radius-tmp:/etc/freeradius/mods-available/eap ./eap && \
    docker rm radius-tmp'

4. Make your own certificates

The image comes with test certificates, which are the same for everyone who downloads it, and valid for 60 days. Make your own: a CA, which devices trust, and a server certificate that the CA signs. Set a random password for their keys, a validity of ten years for the CA and 825 days for the server certificate, Apple's limit for server certificates, and your names:

KEYPW=$(openssl rand -hex 16)
sed -i "s/= whatever/= $KEYPW/" certs/ca.cnf certs/server.cnf eap
sed -i 's/^default_days.*/default_days = 3650/; s/"Example Certificate Authority"/"example.com RADIUS CA"/' certs/ca.cnf
sed -i 's/^default_days.*/default_days = 825/; s/"Example Server Certificate"/"radius.example.com"/' certs/server.cnf

Then remove the test certificates and make yours with the tools in the image:

runuser -u radius -- env HOME=/home/radius XDG_RUNTIME_DIR=/run/user/$uid \
  DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
  bash -lc 'cd /home/radius/radius && docker run --rm \
    -v /home/radius/radius/certs:/etc/freeradius/certs \
    --entrypoint sh docker.io/freeradius/freeradius-server:latest-3.2 \
    -c "cd /etc/freeradius/certs && make destroycerts && ./bootstrap"'

FreeRADIUS runs as user 101 inside its container. Give that group access to the keys, with the same rootless Docker socket:

runuser -u radius -- env HOME=/home/radius XDG_RUNTIME_DIR=/run/user/$uid \
  DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
  bash -lc 'docker run --rm --user root \
    -v /home/radius/radius/certs:/etc/freeradius/certs \
    --entrypoint sh docker.io/freeradius/freeradius-server:latest-3.2 \
    -c "chgrp -R 101 /etc/freeradius/certs && chmod -R g+rX /etc/freeradius/certs"'
openssl x509 -in /home/radius/radius/certs/server.crt -noout -subject -enddate

The last command shows CN=radius.example.com and the date the certificate expires. The other fields, such as O=Example Inc., are shown only in the certificate's details.

5. Add your devices and users

Create a shared secret for your office, and another for testing from the server itself, by running this twice:

openssl rand -hex 16

Create /home/radius/radius/clients.conf, with the first secret in place of SHARED_SECRET and the second in place of LOCAL_SECRET:

# The devices that may ask this server to check logins: one block each.
client office {
    ipaddr = 198.51.100.20
    secret = SHARED_SECRET
}

# For testing from the server itself
client localhost {
    ipaddr = 127.0.0.1
    secret = LOCAL_SECRET
}

Create /home/radius/radius/users, with one line for each person:

# One line per user.
anna    Cleartext-Password := "PASSWORD"

The home folder of radius can be read only by that user and root, so the passwords stay private.

6. Describe the container

As root, create the Compose file:

mkdir -p /home/radius/radius/log
cat > /home/radius/radius/compose.yaml <<'YAML'
services:
  radius:
    image: docker.io/freeradius/freeradius-server:latest-3.2
    container_name: radius
    command: ["-l", "stdout"]
    volumes:
      - /home/radius/radius/clients.conf:/etc/freeradius/clients.conf:ro
      - /home/radius/radius/users:/etc/freeradius/mods-config/files/authorize:ro
      - /home/radius/radius/eap:/etc/freeradius/mods-available/eap:ro
      - /home/radius/radius/certs:/etc/freeradius/certs:ro
      - /home/radius/radius/log:/var/log/freeradius
    ports:
      - "1812:1812/udp"
      - "1813:1813/udp"
    restart: always
YAML
chown -R radius:radius /home/radius/radius

Your files replace the ones in the image, and the log directory keeps the accounting records. -l stdout sends FreeRADIUS' log to docker compose logs. Start it as the user:

runuser -u radius -- env HOME=/home/radius XDG_RUNTIME_DIR=/run/user/$uid \
  DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
  bash -lc 'cd /home/radius/radius && docker compose up -d && docker compose logs radius'

The log ends with Ready to process requests.

7. Test it

Log in as anna from inside the container, first with the password as it is, then with MSCHAPv2, which Wi-Fi uses inside its encrypted connection:

runuser -u radius -- env HOME=/home/radius XDG_RUNTIME_DIR=/run/user/$uid \
  DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
  bash -lc 'cd /home/radius/radius && \
    docker compose exec radius radtest anna PASSWORD 127.0.0.1 0 LOCAL_SECRET && \
    docker compose exec radius radtest -t mschap anna PASSWORD 127.0.0.1 0 LOCAL_SECRET'

Both answer Received Access-Accept. With a wrong password, the answer is Access-Reject.

To add a user, or change a password, edit /home/radius/radius/users and restart with the docker compose restart radius command from step 10. The same goes for clients.conf.

8. Connect Wi-Fi

In your access point or router, choose WPA2-Enterprise or WPA3-Enterprise as the security for the network. Some call it 802.1X. Then enter:

  • RADIUS server: 203.0.113.10, port 1812;
  • Shared secret: the office's secret from step 5;
  • Accounting server, if there is one: the same address, port 1813 and the same secret.

With accounting, the access point reports when each person connects and disconnects. FreeRADIUS saves the reports in a folder for each device, which docker compose exec radius ls /var/log/freeradius/radacct shows from the app directory.

Some devices need your CA to check that they are talking to your server. Print it:

cat /home/radius/radius/certs/ca.pem

Copy everything, from -----BEGIN CERTIFICATE----- to -----END CERTIFICATE-----, to a file called radius-ca.crt, and bring it to the devices that ask for it. On each device, choose the network, and log in with the user name and password from step 5:

  • Android: install radius-ca.crt as a Wi-Fi certificate, under Install a certificate in the security settings. Where it is varies between phones. When you connect, choose PEAP as the EAP method, MSCHAPV2 as Phase 2 authentication, the certificate as CA certificate, and radius.example.com as Domain.
  • iPhone, iPad and Mac: after the user name and password, the device shows the server's certificate. Check that it says radius.example.com, and choose Trust.
  • Windows: Windows asks whether to continue connecting. Choose Show certificate details, check that it says radius.example.com, and choose Connect.
  • Linux: in the network settings, choose Protected EAP (PEAP), the file as CA certificate, and MSCHAPv2 as Inner authentication.

A device that is not given the CA either asks you to trust the certificate, as Apple's and Windows do, or refuses to connect, as Android does. Never tell a device not to check the certificate: anyone could then pretend to be your network and collect passwords.

9. Keep it up to date

Add the weekly update timer from the Docker guide and test it once:

runuser -u radius -- env XDG_RUNTIME_DIR=/run/user/$uid \
  DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus PATH=/usr/bin:/bin \
  systemctl --user enable --now docker-update.timer
runuser -u radius -- env XDG_RUNTIME_DIR=/run/user/$uid \
  DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus PATH=/usr/bin:/bin \
  systemctl --user start docker-update.service

The timer runs docker compose pull and docker compose up -d from /home/radius/radius. The tag latest-3.2 gets every release of FreeRADIUS 3.2. To update now:

runuser -u radius -- env HOME=/home/radius XDG_RUNTIME_DIR=/run/user/$uid \
  DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
  bash -lc 'cd /home/radius/radius && docker compose pull && docker compose up -d'

10. Renew the server certificate

The server certificate from step 4 expires after 825 days, and openssl x509 -in /home/radius/radius/certs/server.crt -noout -enddate shows when. Before then, make a new one with the same CA, so that nothing changes on your devices:

runuser -u radius -- env HOME=/home/radius XDG_RUNTIME_DIR=/run/user/$uid \
  DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
  bash -lc 'cd /home/radius/radius && docker run --rm \
    -v /home/radius/radius/certs:/etc/freeradius/certs \
    --entrypoint sh docker.io/freeradius/freeradius-server:latest-3.2 \
    -c "cd /etc/freeradius/certs && echo \"unique_subject = no\" > index.txt.attr && rm -f server.crt server.csr server.key server.p12 server.pem && make server"'
runuser -u radius -- env HOME=/home/radius XDG_RUNTIME_DIR=/run/user/$uid \
  DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
  bash -lc 'docker run --rm --user root \
    -v /home/radius/radius/certs:/etc/freeradius/certs \
    --entrypoint sh docker.io/freeradius/freeradius-server:latest-3.2 \
    -c "chgrp -R 101 /etc/freeradius/certs && chmod -R g+rX /etc/freeradius/certs"'
runuser -u radius -- env HOME=/home/radius XDG_RUNTIME_DIR=/run/user/$uid \
  DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
  bash -lc 'cd /home/radius/radius && docker compose restart radius'

The first line of the command lets the CA sign a second certificate with the same name. The CA itself lasts ten years.

11. Back up

As root:

umask 077
mkdir -p /root/backup
tar -czf /root/backup/radius.tar.gz -C /home/radius radius

That saves the users, the devices and their secrets, the certificates, with the CA's key, and the Compose file. Copy /root/backup to another machine, and keep it private: with the CA's key, anyone could make a certificate your devices trust.

Troubleshooting

A device gets no answer, and the log shows from unknown client with an address. The device sends from that address, not the one in clients.conf. Put that address in its client block and in the ufw rule from step 1.

The log says Shared secret is incorrect. The secret in the device differs from the one in clients.conf.

A device gets no answer, and the log shows nothing. Check the ufw rule from step 1. If it is right, the device may be too old to send Message-Authenticator, which this version of FreeRADIUS requires, as protection against the Blast-RADIUS attack published in 2024. Update its firmware. If there is no update, and the device does not use Wi-Fi logins, add require_message_authenticator = no to its client block, knowing that it weakens that device's protection.

The container stops with Permission denied for a certificate. Run the chgrp and chmod command from step 4 again.

A phone refuses to connect. Check that it has radius-ca.crt as its CA certificate, and radius.example.com, the name in the server certificate, as its domain.

Run it on your own server

SSD RAID 1 · ECC DDR4 · 10 Gbit

VC-P Alloy

€8.99/mo

vCPU
2
Memory
8 GB
Storage
60 GB
Transfer
10 TB
Performance
SSD · RAID 1
  • Full root access
  • Native /64 IPv6
  • RAID-protected storage
  • Malmö, Sweden
  • Month to month, no lock-in
  • 7-day money-back guarantee
All guides