How to Host a Stardew Valley Multiplayer Server
Stardew Valley supports co-op multiplayer where up to 8 players can share a farm together. While the game does not have an official headless dedicated server, you can host a persistent multiplayer farm on your Breeze instance using a virtual display and automation. This guide walks you through the complete setup process.
System Requirements
A Breeze instance with at least 2 CPU cores, 4 GB of RAM, and 5 GB of storage is recommended. You will also need Xvfb for a virtual display since Stardew Valley requires a graphical environment.
Prerequisites
Install the required dependencies on your Breeze instance:
sudo apt install -y xvfb libxi6 libglu1-mesa libxcursor1 \
libxrandr2 libxinerama1 steamcmd
sudo useradd -m -r -s /bin/bash stardew
sudo su - stardew
Installing the Game
You will need a Steam account that owns Stardew Valley. Install the game via SteamCMD:
mkdir -p ~/stardew_server
steamcmd +force_install_dir ~/stardew_server \
+login your_steam_username \
+app_update 413150 validate \
+quit
Installing SMAPI
SMAPI (Stardew Modding API) is essential for hosting a dedicated server. It enables headless mode and provides mod support:
cd ~/stardew_server
wget https://github.com/Pathoschild/SMAPI/releases/latest/download/SMAPI-installer.zip
unzip SMAPI-installer.zip -d smapi_install
cd smapi_install/SMAPI*installer
./install\ on\ Linux.sh --install-path ~/stardew_server
Configuring for Dedicated Hosting
Install the Always On Server mod which keeps the game running even when the host is not actively playing:
mkdir -p ~/stardew_server/Mods/AlwaysOnServer
Download the mod from the community mod portal and place its files in the directory. Configure the mod’s config.json to set idle behavior, time passage rules, and festival handling.
Starting the Server
Launch the game with a virtual display:
export DISPLAY=:99
Xvfb :99 -screen 0 1024x768x24 &
cd ~/stardew_server
./StardewValley
On first launch, create a new farm with the desired settings and enable multiplayer. Build cabins for each player who will join. Save and exit, then restart to host the farm.
Network Configuration
Players join through Steam friend invites or by direct connection. For direct connections, ensure the game port is accessible:
sudo ufw allow 24642/udp
sudo ufw reload
Multiplayer Settings
Configure multiplayer options through the in-game settings or config files:
- Cabin count — build one cabin per additional player on the farm
- Profit margin — adjust difficulty for group play (75% or 50% recommended)
- Starting cabins — select cabin styles during farm creation for a head start
- Invite code — share the invite code with friends for easy joining
Mod Compatibility
When running mods on your server, ensure all connecting players have the same mods installed. SMAPI will display version mismatches in the console. Popular multiplayer-compatible mods include UI improvements, automation tools, and expanded farming content.
Persistence Tips
- Use
tmuxorscreento keep the session running after SSH disconnect - Set up a cron job to restart the server daily during off-peak hours
- Back up save files from
~/.config/StardewValley/Saves/regularly