Skip to main content

Steam Shared Library

This is how I set up one copy of the Steam game files for multiple Linux users on the same computer. I put the library on a separate Btrfs subvolume so a system rollback leaves the game files alone and I can snapshot them separately if I want to.

Prerequisites​

  • Steam installed for each local user who will use the library. The steps below assume a native Linux Steam install.
  • A Btrfs root filesystem for the optional subvolume steps, and the acl tools (getfacl and setfacl). If you already have a mounted Linux filesystem that supports POSIX ACLs, use a directory on that mount in place of /data/games.
  • Local accounts you trust with write access to the same games. Each user still needs access to the game through their own Steam account. Start with a native Linux game. Proton prefixes live in the game's library under steamapps/compatdata and may need a separate library per user.

Create mount and directory​

Check the filesystem and get its UUID.

findmnt -n -o SOURCE,FSTYPE,UUID /

Replace YOUR_BTRFS_UUID below. Mount Btrfs subvolume ID 5 (the top level) in an empty temporary directory so @data is a sibling of the root subvolume. If you already have an @data subvolume, inspect it before using it.

sudo mkdir -p /mnt/steam-btrfs /data
sudo mount -o subvolid=5 UUID=YOUR_BTRFS_UUID /mnt/steam-btrfs
sudo btrfs subvolume create /mnt/steam-btrfs/@data
sudo umount /mnt/steam-btrfs

Add one entry with sudoedit /etc/fstab.

UUID=YOUR_BTRFS_UUID /data btrfs defaults,noatime,compress=zstd,subvol=/@data 0 0
sudo systemctl daemon-reload
sudo mount /data
findmnt --mountpoint /data

Make sure the mount shows /@data before creating the games directory.

Add user(s) to the games group​

Create the group if it doesn't already exist.

sudo groupadd -f games
sudo usermod -aG games alice
sudo usermod -aG games bob

Replace alice and bob with local usernames. Fully log out and back in before starting Steam so the new group is picked up.

Set directory permissions and default permissions​

sudo install -d -o root -g games -m 2770 /data/games
sudo setfacl -d -m u::rwx,g::rwx,o::--- /data/games

The setgid bit keeps new entries in the games group. The default ACL sets initial permissions for new entries, subject to the mode the application requests.

For an existing library, close Steam for all users and back up the library before changing it. On a library dedicated to this group, apply the group and access permissions to the existing files and the inherited permissions to directories.

sudo chgrp -R games /data/games
sudo chmod -R g+rwX,o-rwx /data/games
sudo find /data/games -type d -exec chmod g+s {} +
sudo find /data/games -type d -exec setfacl -d -m u::rwx,g::rwx,o::--- {} +

Verify permissions​

id -nG
getfacl /data/games

From the first account, run touch /data/games/.permission-check. From the second, append to that file and remove it. This checks access to an existing file as well as the ability to create one.

Configure Steam​

Open Steam → Settings → Storage and add /data/games as a library for each user. Move or install a small game from the first account. Exit Steam, log in as the second user, and verify that Steam sees the installation and can launch a game that account owns. Close one Steam session before letting another update the library. If a Proton title fails with a prefix ownership error, keep it in that user's own library.

References​