Rewritten in October 2026. The first version of this guide, from January 2023, ran the server in a Lima VM under full x86 emulation with QEMU. That no longer works with Valheim 1.0, so this is the method I use now.
Valheim's dedicated server is built only for Intel and AMD processors (x86-64), and Iron Gate have shown no sign of an Arm build. An Apple Silicon Mac therefore has to translate it, and the obvious translators do not cope:
| Approach | Result |
|---|---|
| Full x86 emulation with QEMU (my 2023 method) | The server's Mono runtime crashes while loading |
| Rosetta inside a Linux VM | The same crash: Assertion: should not be reached at tramp-amd64.c:641 |
| Box64 in an arm64 container | Starts, loads the world and runs |
Box64 translates x86-64 Linux programs to Arm as they run, and it is clever enough to swap many of the program's libraries for native Arm builds. That is what this guide is built on.
What you need
- An Apple Silicon Mac that stays on, with 16 GB of memory or more; the VM below takes 8 GB.
- Homebrew.
- About 35 GB of free disk.
- Your world, if you are bringing one over.
1. Give Valheim a VM of its own
I run the rest of my homelab in Colima's default VM. Valheim gets a separate one (a Colima profile), so a busy world never slows anything else, and so its settings can differ.
brew install colima docker docker-compose
mkdir -p ~/valheim/config ~/valheim/data
colima start valheim --arch aarch64 --vm-type vz --port-forwarder grpc \
--cpu 4 --memory 8 --disk 30 --mount ~/valheim:w
What the flags do:
--arch aarch64 --vm-type vz: a native Arm Linux VM on Apple's Virtualization framework. No emulation at this level; Box64 does the translating later.--port-forwarder grpc: Valheim talks UDP, and Colima's default forwarder (over SSH) carries only TCP. This one carries both.--mount ~/valheim:w: shares just this folder with the VM, writable, so the world lives on the Mac where you can see and back it up.
Starting a profile makes it Docker's current context. If you use another Colima VM too, docker context use colima switches plain docker commands back to the default one; for Valheim, point Docker at it explicitly:
export DOCKER_HOST="unix://$HOME/.colima/valheim/docker.sock"
2. Download the server with DepotDownloader
The usual way to fetch a dedicated server is steamcmd, but steamcmd is a 32-bit x86 program, which Box64 does not run. DepotDownloader does the same job and has a native build for Apple Silicon, so the download happens on the Mac, straight into the shared folder:
mkdir -p ~/.local/share/depotdownloader && cd ~/.local/share/depotdownloader
curl -fsSLO https://github.com/SteamRE/DepotDownloader/releases/download/DepotDownloader_3.4.0/DepotDownloader-macos-arm64.zip
unzip -o DepotDownloader-macos-arm64.zip && chmod +x DepotDownloader
./DepotDownloader -app 896660 -os linux -osarch 64 -dir ~/valheim/data/server
chmod +x ~/valheim/data/server/valheim_server.x86_64
App 896660 is the Valheim Dedicated Server, which Steam lets anyone download without signing in. It is about 2 GB. Note -os linux: the server runs in Linux, whatever the Mac is.
3. Build the image
Box64 is compiled from source inside the image build, which takes a few minutes the first time. Save this as ~/valheim/build/Dockerfile:
FROM debian:bookworm-slim AS box64
ARG BOX64_VERSION=v0.4.4
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl cmake build-essential python3
RUN curl -fsSL "https://github.com/ptitSeb/box64/archive/refs/tags/${BOX64_VERSION}.tar.gz" | tar -xz -C /tmp \
&& cmake -S /tmp/box64-* -B /tmp/build -DARM_DYNAREC=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo \
&& make -C /tmp/build -j"$(nproc)" && make -C /tmp/build install DESTDIR=/out
FROM debian:bookworm-slim
RUN dpkg --add-architecture amd64 \
&& apt-get update && apt-get install -y --no-install-recommends \
ca-certificates tzdata procps tini \
libatomic1 libpulse0 libpulse-mainloop-glib0 \
libatomic1:amd64 libpulse0:amd64 libstdc++6:amd64 \
libogg0:amd64 libvorbis0a:amd64 libvorbisenc2:amd64 \
&& rm -rf /var/lib/apt/lists/* \
&& cd /usr/lib/aarch64-linux-gnu \
&& for l in libatomic libpulse libpulse-simple libpulse-mainloop-glib; do \
ln -sf "$(ls $l.so.* | head -1)" "$l.so"; done
COPY --from=box64 /out/ /
ENV BOX64_DYNAREC_BLEEDING_EDGE=0 \
BOX64_DYNAREC_STRONGMEM=3 \
BOX64_LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libogg.so.0:/usr/lib/x86_64-linux-gnu/libvorbis.so.0:/usr/lib/x86_64-linux-gnu/libvorbisenc.so.2
COPY --chmod=755 entrypoint.sh /usr/local/bin/entrypoint.sh
WORKDIR /opt/valheim/server
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/entrypoint.sh"]
The fiddly lines each earned their place:
- The amd64 libraries and the symlinks. Valheim's crossplay library,
libparty.so(PlayFab Party), needslibatomicandlibpulse. Box64 substitutes native Arm builds for those and looks for them by their bare names, hence the symlinks; the x86 copies are the fallback for anything it does not substitute. BOX64_LD_PRELOAD.libparty.socalls intoliboggandlibvorbis(voice chat) without declaring them, so it fails to load, and crossplay with it, unless they are loaded first.BOX64_DYNAREC_STRONGMEM=3. Stability over speed: the strictest memory ordering avoids races between Unity's threads.tini. It passes Docker's stop signal on, so the server gets the chance to save.
And the entrypoint.sh beside it, which starts the server through Box64 and saves the world on the way out:
#!/usr/bin/env bash
set -uo pipefail
args=(-nographics -batchmode -name "$SERVER_NAME" -port 2456 -world "$WORLD_NAME"
-password "$SERVER_PASS" -savedir /config -public "${SERVER_PUBLIC:-1}")
[[ "${CROSSPLAY:-false}" == true ]] && args+=(-crossplay)
cd /opt/valheim/server
export LD_LIBRARY_PATH="/opt/valheim/server/linux64" SteamAppId=892970
box64 ./valheim_server.x86_64 "${args[@]}" &
server=$!
# Valheim saves on SIGINT
trap 'kill -INT "$server"; wait "$server"; exit 0' TERM INT
wait "$server"
4. The Compose file
In ~/valheim/build/docker-compose.yml:
services:
valheim:
build: .
image: valheim:box64
platform: linux/arm64
restart: unless-stopped
volumes:
- ${HOME}/valheim/config:/config
- ${HOME}/valheim/data:/opt/valheim
ports:
- "2456-2457:2456-2457/udp"
environment:
SERVER_NAME: My server
WORLD_NAME: MyWorld
SERVER_PASS: ${VALHEIM_SERVER_PASS} # at least 5 characters, kept in .env
SERVER_PUBLIC: "1"
CROSSPLAY: "true"
TZ: Europe/London
stop_grace_period: 2m
Keep the password in a .env file beside it rather than in the Compose file. stop_grace_period gives the server two minutes to save a large world before Docker loses patience.
5. Bring your world across (optional)
Worlds go in ~/valheim/config/worlds_local/. On a Mac client they live in ~/Library/Application Support/IronGate/Valheim/worlds_local; a dedicated server from before 1.0 keeps a .fwl and a .db per world. Copy both, and set WORLD_NAME to the file name without the extension. A pre-1.0 world is converted on its first load, and the server keeps the original beside it as <world>_backup_<time>.
6. Start it
cd ~/valheim/build
docker compose up -d --build
docker compose logs -f
Loading takes a few minutes under translation. The server is ready when the log shows Game server connected with nothing after it; a few Game server connected failed lines while it starts are only retries. Red Box64 warnings about libSDL3 are harmless. With crossplay on, the log also gives a join code, which changes at every start:
docker compose logs | grep -i "join code"
Now and then Box64 aborts while the server starts (Native Crash Reporting, exit code 134). The restart policy starts it again, and the next attempt usually gets through.
7. Connecting: an open question
I should be candid here: this is the part I have not yet seen work end to end.
There are two ways in. Crossplay (-crossplay) routes players through PlayFab's relay: they find the server by name in the community list or enter the join code under Join game › Add server, and no ports need opening at home. Under Box64 the server does all of its side of this properly: it signs in to PlayFab, opens its lobby and hands out a join code, and clients find the lobby by that code. So far, though, no player's connection has ever reached the server. The only client tried was a locked-down work laptop, which may well be blocking game traffic, so the test that settles it (a personal machine) is still to come.
Direct IP joins (crossplay off, Join IP with the Mac's address and port 2456) use Steam's networking instead. The server answers Steam's status queries on UDP 2457, yet the one game connection tried from my home network went unanswered, and the log suggests Steam's networking starts up out of order under Box64. Players outside the house would also need UDP 2456 to 2457 forwarded through every router in the way; my Minecraft guide explains doing that with two routers.
I will update this section once I know which of these works. Should you get either going on a similar setup, I would be glad to hear how.
Keeping it running
- Updates. Clients refuse a server older than themselves, so stay current. Stop the server, run the DepotDownloader command from step 2 again (it fetches only what changed), and start it. DepotDownloader's
-manifest-onlyflag asks Steam for the current build without downloading it, which makes for an easy hourly check that updates only when the build has changed and nobody is playing. - Backups. The game keeps a few rolling copies of its own, but a nightly
tarof~/valheim/config/worlds_localto somewhere else is cheap insurance. Leave out the*_backup_auto*and*.oldfiles, which only bloat it. - A watchdog. Mine is a LaunchAgent that runs every five minutes: it starts the VM and server if they are down (so a power cut fixes itself), restarts a server Docker reports unhealthy, and restarts one that has hung, which it spots because the server stops writing its
Connectionsline, logged every ten minutes.
When it does not work
Assertion: should not be reached at tramp-amd64.c:641. The server is running under Rosetta or QEMU rather than Box64. Check that the VM isaarch64and the imagelinux/arm64.- Crossplay never registers, or
libparty.sofails to load. The libraries from step 3 are missing, most often the preloadedliboggandlibvorbis. - Nothing reaches the server, even on the home network. Check that the VM uses the
grpcport forwarder (~/.colima/valheim/colima.yaml). The flag only applies when a profile is first created, so for an existing VM change the file andcolima restart valheim. - Plain
dockercommands suddenly reach the wrong VM. Starting a Colima profile makes it the current context;docker context use colimaputs the default back.