⚠️ The latest release is unstable. Use preview builds instead
Skip to content

Building from Source

Requirements

  • Docker >=20
  • git >=2
  • make >=4
  • .NET SDK 6
  • A local installation of Stardew Valley (via Steam)

Setup

1. Clone the Repository

Clone the repository with its submodules:

sh
mkdir sdvd-server
cd sdvd-server
git clone --recurse-submodules git@github.com:stardew-valley-dedicated-server/server.git .

2. Configure your IDE

Update JunimoServer.csproj to enable autocompletion and build support in your IDE.

3. Set the Game Path

Specify the path to your local Stardew Valley installation:

xml
<GamePath>C:\path\to\Stardew Valley</GamePath>

4. Create Configuration

Copy the .env.example file from the repository.

Rename .env.example to .env and configure your server settings:

sh
# Steam Account Details (required for downloading the game server)
STEAM_USERNAME=""
STEAM_PASSWORD=""

# VNC Server (for web-based administration access)
VNC_PASSWORD=""

Usage

Build and Start

To build and start the server:

sh
make up

View Logs

To see logs:

sh
docker compose logs -f

Stop the Server

To save and stop the server:

sh
docker compose down

Make Commands

The Makefile provides several useful commands:

CommandDescription
make installInstall development dependencies (commitlint, git hooks)
make setupRun first-time Steam authentication and game download
make upBuild and start all containers
make downStop all containers
make logsFollow container logs
make cliAttach to interactive server console
make cleanRemove ALL containers, volumes, and images

Using git worktrees

Each worktree is a separate folder, so its Compose project name defaults to that folder's name and it gets its own empty volumes. make setup then makes you log into Steam and download the game again (and too many logins can get you rate-limited).

To share your main checkout's volumes across worktrees, pin an explicit project name in the main checkout's .env:

sh
COMPOSE_PROJECT_NAME=sdvd-server

Use your main checkout's folder name — sdvd-server if you followed the clone step above. Claude-created worktrees copy the main .env, so they inherit the same project name and share its volumes automatically; a worktree you add by hand with git worktree add does not get the copy, so set the line in its .env yourself.

Both checkouts then form one Compose project, and because the services use fixed container_names only one can run at a time. make down and make clean from a worktree stop or remove the shared containers and volumes — run them from whichever checkout you actually mean to affect.

Project Structure

server/
├── mod/                    # JunimoServer SMAPI mod
│   └── JunimoServer/       # Main mod source
├── docker/                 # Docker configuration
├── docs/                   # Documentation (VitePress)
├── tests/                  # Test infrastructure
│   ├── JunimoServer.Tests/ # E2E test assembly
│   ├── JunimoServer.TestRunner/ # Custom test runner
│   ├── test-client/        # E2E test client (SMAPI mod)
│   └── test-ui/            # Test monitoring web UI
└── tools/                  # Utility tools
    ├── steam-service/      # Steam authentication service
    └── discord-bot/        # Discord bot integration

Released under the MIT License.