
Host a Stardew Valley Dedicated Server
Stardew Valley is a farming simulation RPG with cooperative multiplayer. Host a dedicated server so friends can join your farm anytime, even when you're offline. Requires SMAPI (Stardew Modding API) and server-side mods for headless operation. Supports up to 10 farmhands by default.
Hardware Requirements
Here's what you need to run a Stardew Valley dedicated server.
Economy
Small farm, 1-4 players
Standard
Medium farm, 4-8 players
Pro
Large farm, 8-10 players with mods
Start hosting from your own computer
Run a Stardew Valley server on your desktop, laptop, VPS, or dedicated machine — GameCP automates Docker setup, resource allocation, and Stardew Valley configuration instantly. Automatic port forwarding means your friends can connect without touching your router. Start local, scale to a VPS when you're ready.
Setup in 4 Steps
Skip the manual SteamCMD installation, port forwarding, and systemd configuration. Install on your own computer and start hosting instantly.
The Manual Way vs. GameCP
Manual Setup
- ✗ Install SteamCMD manually
- ✗ Configure 1+ firewall ports and router settings
- ✗ Write systemd service files
- ✗ SSH into server to edit configs
- ✗ Requires a VPS or dedicated server
- ✗ 30-60 minutes if experienced
With GameCP
- One-click SteamCMD install
- Automatic port forwarding — no router config
- Host from your own PC, VPS, or dedicated server
- Docker container with auto-restart
- Visual config editor in browser
- Under 5 minutes total
Under the Hood
The full manual process to host a Stardew Valley dedicated server on a VPS. Or install GameCP on your own computer and skip all of this.
Configure & Prepare
Set your server settings, then install Docker, SteamCMD, and pull the Stardew Valley container image.
# Update system and install Docker sudo apt update && sudo apt install -y docker.io sudo systemctl enable --now docker # Create game server directory sudo mkdir -p /opt/gameserver # Install SteamCMD sudo mkdir -p /opt/steamcmd curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | sudo tar zxvf - -C /opt/steamcmd # Server configuration export SERVER_NAME="GameCP Stardew Farm" export MAX_PLAYERS="4" export SLEEP_TIME="2200" export FESTIVALS_ON="true" export CLIENTS_CAN_PAUSE="false" export PROFIT_MARGIN="100" export AUTO_UPDATE="1" # Pull the container image docker pull ghcr.io/gamecp/runtimes:stardew
Install Server Files via SteamCMD
Download the Stardew Valley dedicated server using Steam App ID 413150.
# Download Stardew Valley server files (App ID: 413150)
/opt/steamcmd/steamcmd.sh \
+force_install_dir /opt/gameserver \
+login ${STEAM_USER} \
+app_update 413150 validate \
+quitOpen Firewall Ports
Stardew Valley requires 1 port to be open for game traffic and queries.
sudo ufw allow 24642/udp
Launch the Server
Start the Stardew Valley server using the configuration from Step 1.
Create the startup script
# Create the startup script cat > /opt/gameserver/start.sh << 'EOF' #!/bin/bash # Stardew Valley Dedicated Server # Start Xvfb virtual display rm -f /tmp/.X99-lock 2>/dev/null Xvfb :99 -screen 0 884x515x24 -ac & sleep 2 export DISPLAY=:99 # Self-heal: install SMAPI if missing if [ ! -f ./StardewModdingAPI.deps.json ]; then echo "SMAPI not properly installed, running installer..." curl -sL "https://github.com/Pathoschild/SMAPI/releases/download/4.5.1/SMAPI-4.5.1-installer.zip" -o /tmp/smapi.zip mkdir -p /tmp/smapi-install unzip -qo /tmp/smapi.zip -d /tmp/smapi-install/ # Find the installer binary INSTALLER= INSTALLER_DIR= if [ -n "" ]; then chmod +x "" cd "" # Pipe input: 2=light text, game path, 1=install, Y=confirm printf '2\n/home/container\n1\nY\n' | "" || true cd /home/container echo "SMAPI installer completed." else echo "ERROR: SMAPI.Installer not found" exit 1 fi rm -rf /tmp/smapi-install /tmp/smapi.zip if [ -f ./StardewModdingAPI.deps.json ]; then echo "SMAPI installed and verified." else echo "WARNING: SMAPI deps.json still missing after install." fi fi # Clean up old broken mod folders (leftovers from previous installs) [ -d "Mods/Always On Server" ] && [ ! -f "Mods/Always On Server/manifest.json" ] && rm -rf "Mods/Always On Server" && echo "Cleaned up old 'Always On Server' folder" [ -d "Mods/UnlimitedPlayers" ] && [ ! -f "Mods/UnlimitedPlayers/manifest.json" ] && rm -rf "Mods/UnlimitedPlayers" && echo "Cleaned up old 'UnlimitedPlayers' folder" # Install required mods if missing if [ ! -f "Mods/AlwaysOnServer/manifest.json" ] || [ ! -f "Mods/ServerAutoLoad/manifest.json" ] || [ ! -f "Mods/AutoHideHost/manifest.json" ] || [ ! -f "Mods/SkillLevelGuard/manifest.json" ]; then echo "Installing server mods..." curl -sL "https://dl.gamecp.com/stardew/mods-pack-v3.zip" -o /tmp/mods.zip if [ -f /tmp/mods.zip ]; then mkdir -p Mods unzip -qo /tmp/mods.zip -d Mods/ rm -f /tmp/mods.zip echo "Server mods installed (AlwaysOnServer, ServerAutoLoad, AutoHideHost, SkillLevelGuard)." fi fi # Self-heal: download default save if none exist SAVES_DIR=".config/StardewValley/Saves" mkdir -p "" if [ -z "" ]; then echo "Downloading default save..." curl -sL "https://dl.gamecp.com/stardew/default-save-v2.zip" -o /tmp/save.zip unzip -qo /tmp/save.zip -d "/" rm -f /tmp/save.zip echo "Default save installed." fi # Set up startup_preferences if missing PREFS=".config/StardewValley/startup_preferences" if [ ! -f "" ]; then echo "Creating headless server config..." cat > "" << 'PREFEOF' <?xml version="1.0" encoding="utf-8"?> <StartupPreferences xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <startMuted>false</startMuted> <timesPlayed>2</timesPlayed> <windowMode>0</windowMode> <playerLimit>-1</playerLimit> <fullscreenResolutionX>884</fullscreenResolutionX> <fullscreenResolutionY>515</fullscreenResolutionY> <lastEnteredIP /> <languageCode>en</languageCode> <clientOptions> <fullscreen>false</fullscreen> <windowedBorderlessFullscreen>true</windowedBorderlessFullscreen> <ipConnectionsEnabled>true</ipConnectionsEnabled> <enableServer>true</enableServer> <enableFarmhandCreation>true</enableFarmhandCreation> <serverPrivacy>FriendsOnly</serverPrivacy> <musicVolumeLevel>0</musicVolumeLevel> <soundVolumeLevel>0</soundVolumeLevel> <footstepVolumeLevel>0</footstepVolumeLevel> <ambientVolumeLevel>0</ambientVolumeLevel> <preferredResolutionX>884</preferredResolutionX> <preferredResolutionY>515</preferredResolutionY> </clientOptions> </StartupPreferences> PREFEOF fi echo "Starting Stardew Valley with SMAPI..." chmod +x ./StardewModdingAPI ./StardewModdingAPI EOF chmod +x /opt/gameserver/start.sh
Run the container
docker run -d \ --name stardew-valley-server \ -p 24642:24642/udp \ -e SERVER_NAME="GameCP Stardew Farm" \ -e MAX_PLAYERS="4" \ -e SLEEP_TIME="2200" \ -e FESTIVALS_ON="true" \ -e CLIENTS_CAN_PAUSE="false" \ -e PROFIT_MARGIN="100" \ -e AUTO_UPDATE="1" \ -v /opt/gameserver:/opt/gameserver \ -w /opt/gameserver \ ghcr.io/gamecp/runtimes:stardew \ ./start.sh
Or skip all of this
GameCP automates every step above: Docker, SteamCMD, port forwarding, startup, and config. Install on your own PC and deploy a Stardew Valley server in under 5 minutes.
Deploy with GameCPMore Hosting Guides
Explore step-by-step setup guides for other popular games supported by GameCP.
Ready to Host Your Stardew Valley Server?
Install GameCP on your own computer and start hosting in minutes. Automatic port forwarding, zero config — your friends connect instantly.
No credit card required · Free tier available · Install local, scale later