• Stars
    star
    766
  • Rank 59,308 (Top 2 %)
  • Language
    Rust
  • License
    BSD 3-Clause "New...
  • Created almost 4 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Valheim Docker powered by Odin. The Valheim dedicated gameserver manager which is designed with resiliency in mind by providing automatic updates, world backup support, and a user friendly cli interface.

Valheim

All Contributors

Table of Contents

Running on a bare-metal Linux Server

From Release

  1. Navigate to https://github.com/mbround18/valheim-docker/releases/latest
  2. Download the bundle.zip to your server
  3. Extract the bundle.zip
  4. Make the files executable chmod +x {odin,huginn}
  5. Optional: Add the files to your path.
  6. Navigate to the folder where you want your server installed.
  7. Run odin configure --password "Your Super Strong Password" (you can also supply --name "Server Name", --port "Server Port", or other arguments available.)
  8. Finally, run odin start.

More in-depth How-to Article: https://dev.to/mbround18/running-valheim-on-an-linux-server-4kh1

From Source

This repo bundles its tools in a way that you can run them without having to install docker! If you purely want to run this on a Linux based system, without docker, take a look at the links below <3

  • Installing & Using Odin The tool Odin runs the show and does almost all the heavy lifting in this repo. It starts, stops, and manages your Valheim server instance.
  • Installing & Using Huginn Looking for a way to view the status of your server? Look no further than Huginn! The Huginn project is a http server built on the same source as Odin and uses these capabilities to expose a few http endpoints.

Using the binaries to run on an Ubuntu Server, you will have to be more involved and configure a few things manually. If you want a managed, easy one-two punch to manage your server. Then look at the Docker section <3

Running with Docker

This image does use verion 3+ for all of its compose examples. Please use Docker engine >=20 or make adjustments accordingly.

If you are looking for a guide on how to get started click here

Mod Support! It is supported to launch the server with BepInEx but!!!!! as a disclaimer! You take responsibility for debugging why your server won't start. Modding is not supported by the Valheim developers officially yet; Which means you WILL run into errors. This repo has been tested with running ValheimPlus as a test mod and does not have any issues. See Getting started with mods

Download Locations

DockerHub

DockerHub Valheim DockerHub Odin

GitHub Container Registry

GHCR Valheim GHCR Odin

Environment Variables

See further on down for advanced environment variables.

Variable Default Required Description
PORT 2456 TRUE Sets the port your server will listen on. Take note it will also listen on +2 (ex: 2456, 2457, 2458)
NAME Valheim Docker TRUE The name of your server! Make it fun and unique!
WORLD Dedicated TRUE This is used to generate the name of your world.
PUBLIC 1 FALSE Sets whether or not your server is public on the server list.
PASSWORD <please set me> TRUE Set this to something unique!
ENABLE_CROSSPLAY 0 FALSE Enable crossplay support as of Valheim Version >0.211.8
TYPE Vanilla FALSE This can be set to ValheimPlus, BepInEx, BepInExFull or Vanilla
MODS <nothing> FALSE This is an array of mods separated by comma and a new line. Click Here for Examples Supported files are zip, dll, and cfg.
WEBHOOK_URL <nothing> FALSE Supply this to get information regarding your server's status in a webhook or Discord notification! Click here to learn how to get a webhook url for Discord
WEBHOOK_INCLUDE_PUBLIC_IP 0 FALSE Optionally include your server's public IP in webhook notications, useful if not using a static IP address. NOTE: If your server is behind a NAT using PAT with more than one external IP address (very unlikely on a home network), this could be inaccurate if your NAT doesn't maintain your server to a single external IP.
UPDATE_ON_STARTUP 1 FALSE Tries to update the server the container is started.
ADDITIONAL_STEAMCMD_ARGS `` FALSE Sets optional arguments for install

Container Env Variables

Variable Default Required Description
TZ America/Los_Angeles FALSE Sets what timezone your container is running on. This is used for timestamps and cron jobs. Click Here for which timezones are valid.
PUID 1000 FALSE Sets the User Id of the steam user.
PGID 1000 FALSE Sets the Group Id of the steam user.

Auto Update

Variable Default Required Description
AUTO_UPDATE 0 FALSE Set to 1 if you want your container to auto update! This means at the times indicated by AUTO_UPDATE_SCHEDULE it will check for server updates. If there is an update then the server will be shut down, updated, and brought back online if the server was running before.
AUTO_UPDATE_SCHEDULE 0 1 * * * FALSE This works in conjunction with AUTO_UPDATE and sets the schedule to which it will run an auto update. If you need help figuring out a cron schedule click here
AUTO_UPDATE_PAUSE_WITH_PLAYERS 0 FALSE Does not process an update for the server if there are players online.

Auto update job, queries steam and compares it against your internal steam files for differential in version numbers.

Auto Backup

Variable Default Required Description
AUTO_BACKUP 0 FALSE Set to 1 to enable auto backups. Backups are stored under /home/steam/backups which means you will have to add a volume mount for this directory.
AUTO_BACKUP_SCHEDULE */15 * * * * FALSE Change to set how frequently you would like the server to backup. If you need help figuring out a cron schedule click here.
AUTO_BACKUP_NICE_LEVEL NOT SET FALSE Do NOT set this variable unless you are following this guide here
AUTO_BACKUP_REMOVE_OLD 1 FALSE Set to 0 to keep all backups or manually manage them.
AUTO_BACKUP_DAYS_TO_LIVE 3 FALSE This is the number of days you would like to keep backups for. While backups are compressed and generally small it is best to change this number as needed.
AUTO_BACKUP_ON_UPDATE 0 FALSE Create a backup on right before updating and starting your server.
AUTO_BACKUP_ON_SHUTDOWN 0 FALSE Create a backup on shutdown.
AUTO_BACKUP_PAUSE_WITH_NO_PLAYERS 0 FALSE Will skip creating a backup if there are no players. PUBLIC must be set to 1 for this to work!

Auto backup job produces an output of a *.tar.gz file which should average around 30mb for a world that has an average of 4 players consistently building on. You should be aware that if you place the server folder in your saves folder your backups could become astronomical in size. This is a common problem that others have observed, to avoid this please follow the guide for how volume mounts should be made in the docker-compose.yml.

Scheduled Restarts

Scheduled restarts allow th operator to trigger restarts on a cron job

Variable Default Required Description
SCHEDULED_RESTART 0 FALSE Allows you to enable scheduled restarts
SCHEDULED_RESTART_SCHEDULE 0 2 * * * FALSE Defaults to everyday at 2 am but can be configured with valid cron

Docker Compose

This image does use verion 3+ for all of its compose examples. Please use Docker engine >=20 or make adjustments accordingly.

Simple

This is a basic example of a docker compose, you can apply any of the variables above to the environment section below but be sure to follow each variables' description notes!

version: "3"
services:
  valheim:
    image: mbround18/valheim:latest
    stop_signal: SIGINT
    ports:
      - "2456:2456/udp"
      - "2457:2457/udp"
      - "2458:2458/udp"
    environment:
      PORT: 2456
      NAME: "Created With Valheim Docker"
      WORLD: "Dedicated"
      PASSWORD: "Banana Phone"
      TZ: "America/Chicago"
      PUBLIC: 1
    volumes:
      - ./valheim/saves:/home/steam/.config/unity3d/IronGate/Valheim
      - ./valheim/server:/home/steam/valheim

Everything but the kitchen sink

version: "3"
services:
  valheim:
    image: mbround18/valheim:latest
    stop_signal: SIGINT
    ports:
      - "2456:2456/udp"
      - "2457:2457/udp"
      - "2458:2458/udp"
    environment:
      PORT: 2456
      NAME: "Created With Valheim Docker"
      WORLD: "Dedicated"
      PASSWORD: "Strong! Password @ Here"
      TZ: "America/Chicago"
      PUBLIC: 1
      AUTO_UPDATE: 1
      AUTO_UPDATE_SCHEDULE: "0 1 * * *"
      AUTO_BACKUP: 1
      AUTO_BACKUP_SCHEDULE: "*/15 * * * *"
      AUTO_BACKUP_REMOVE_OLD: 1
      AUTO_BACKUP_DAYS_TO_LIVE: 3
      AUTO_BACKUP_ON_UPDATE: 1
      AUTO_BACKUP_ON_SHUTDOWN: 1
      WEBHOOK_URL: "https://discord.com/api/webhooks/IM_A_SNOWFLAKE/AND_I_AM_A_SECRET"
      WEBHOOK_INCLUDE_PUBLIC_IP: 1
      UPDATE_ON_STARTUP: 0
    volumes:
      - ./valheim/saves:/home/steam/.config/unity3d/IronGate/Valheim
      - ./valheim/server:/home/steam/valheim
      - ./valheim/backups:/home/steam/backups

Bundled Tools

Odin

This repo has a CLI tool called Odin in it! It is used for managing the server inside the container. If you are looking for instructions for it click here: Odin

Click here to see advanced environment variables for Odin

Huginn Http Server

Variable Default Required Description
ADDRESS Your Public IP FALSE This setting is used in conjunction with odin status and setting this will stop odin from trying to fetch your public IP
HTTP_PORT anything above 1024 FALSE Setting this will spin up a little http server that provides two endpoints for you to call.
  • /metrics provides a prometheous style metrics output.
  • /status provides a more traditional status page.

Note on ADDRESS this can be set to 127.0.0.1:<your query port> or <your public ip>:<your query port> but does not have to be set. If it is set, it will prevent odin from reaching out to aws ip service from asking for your public IP address. Keep in mind, your query port is +1 of what you set in the PORT env variable for your valheim server.

Another note: your server MUST be public (eg. PUBLIC=1) in order for Odin+Huginn to collect and report statistics.

Feature Information

BepInEx Support

As of March 2021 the TYPE variable can be used to automatically install BepInEx. For details see Getting started with mods.

Webhook Support

This repo can automatically send notifications to discord via the WEBHOOK_URL variable. Only use the documentation link below if you want advanced settings!

Click Here to view documentation on Webhook Support

Guides

How to Transfer Files

This is a tutorial of a recommended path to transfering files. This can be done to transfer world files between hosts, transfer BepInEx configs, or even to transfer backups.

Click Here to view the tutorial of how to transfer files.

How to access your container in docker

docker exec -it $CONTAINER_NAME gosu steam bash

Additional Information

Discord Release Notifications

If you would like to have release notifications tied into your Discord server, click here:

Discord Banner

Note: The discord is PURELY for release notifications and any + all permissions involving sending chat messages has been disabled. Any support for this repository must take place on the Discussions.

Versions

  • latest (Stable): Mod support! and cleaned up the code base.
  • 1.4.x (Stable): Webhook for discord upgrade.
  • 1.3.x (Stable): Health of codebase improvements.
  • 1.2.0 (Stable): Added additional stop features and sig for stopping.
  • 1.1.1 (Stable): Patch to fix arguments
  • 1.1.0 (Unstable): Cleaned up image and made it faster
  • 1.0.0 (Stable): It works!

Sponsors

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Mark

๐Ÿ“–

Michael

๐Ÿš‡ ๐Ÿ’ป ๐Ÿ“–

imgbot[bot]

๐Ÿ“–

Jonathan Boudreau

๐Ÿ’ป

Lukรกลก Hruลกka

๐Ÿ“–

Julian Vallรฉe

๐Ÿ’ป

Finomnis

๐Ÿ’ป

Justin Byrne

๐Ÿ“–

Andrew Peabody

๐Ÿ“– ๐Ÿ’ป

Jorge Morales

๐Ÿ’ป

Spanner_Man

๐Ÿ“–

Cameron Pittman

๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind welcome!

More Repositories

1

enshrouded-docker

๐ŸŒŸ Welcome to the ultimate enshrouded Server Setup! ๐ŸŒ This GitHub repository is your go-to toolkit ๐Ÿ› ๏ธ for launching an enshrouded server in a snap using Docker!
Python
28
star
2

palworld-docker

๐ŸŒŸ Welcome to the ultimate Palworld Server Setup! ๐ŸŒ This GitHub repository is your go-to toolkit ๐Ÿ› ๏ธ for launching a Palworld server in a snap using Docker! Choose from preset worlds like 'casual' ๐Ÿ–๏ธ, 'normal' ๐ŸŒ†, or 'hard' ๐ŸŒ‹, or dive deep into customization with flexible settings ๐ŸŽ›๏ธ.
Python
24
star
3

foundryvtt-docker

A simple docker image for hosting FoundryVTT
Rust
21
star
4

setup-osxcross

Github Action for setting up osxcross in a github action for cross compiling from Linux to Mac
16
star
5

ark-manager-web

This is a web UI utility for Ark Manager which is provided by ark-server-tools. Please review the readme below and check the issues tab before installing!!! If you need support please create an issue or tweet @MBRound18
Rust
16
star
6

foundryvtt-discord-auth

FoundryVTT Discord Authentication
JavaScript
5
star
7

redirect

Simple redirection tool! Ready to use, docker capable, Kubernetes friendly, any Linux based env ready!
Rust
5
star
8

wiki-js-timeline

WikiJS Timeline source code
CSS
3
star
9

vtt-maps

Immerse yourself in epic adventures with custom-made Virtual Table Top maps for Dungeons and Dragons. Created for my own games and now available for anyone, these maps are perfect for enhancing your campaigns with engaging, detailed environments. Whether you're a veteran DM or new to the game, these maps are ready for your next adventure!
Rust
3
star
10

webpack-wasm-template

JavaScript
2
star
11

v-rising-configs

Generate V-Rising server configuration
JavaScript
2
star
12

oss-development-breakdown

Breakdown of my monthly Open Source development costs.
2
star
13

karl-bot

A simple bot to troll my friend Karl
Rust
2
star
14

foundryvtt-types

FoundryVTT generated types for module creation
2
star
15

showcase-yourself

This is a very simple personal professional website to showcase yourself! :) See the website link for an example. The config.json in the src directory is just an example.
JavaScript
2
star
16

auto

This is an action wrapping the auto binary for GitHub Action usage.
Shell
2
star
17

foundry-anvil

A node cli tool to initialize and template out the boilerplate stuff required for a FoundryVTT Module
TypeScript
2
star
18

docker-cargo-make

Bundle Cargo & Cargo Make into a docker file for easy CI use or to use in dockerfiles.
Dockerfile
2
star
19

wikijs-module-meilisearch

Millisearch module for wikijs, wicked fast searching at the tips of your fingers!
Rust
2
star
20

backup-docker

Python
2
star
21

jellyfin-utils

Simple jellyfin utils
JavaScript
1
star
22

pkg-vercel

Dockerfile
1
star
23

mc-doubletap-panel

Vue
1
star
24

trunk-rs

1
star
25

mc-doubletap

A Minecraft plugin which provides a GraphQL interface into your server.
Java
1
star
26

gh-reusable

A collection of reusable GitHub Actions and Workflows designed to streamline your CI/CD pipelines and automate common tasks. Easily integrate these actions and workflows into your projects to enhance efficiency and maintain consistency across your repositories.
Dockerfile
1
star
27

mbround18

1
star
28

url_shortener

I got tired of url shorteners that are out there in the world and was not interested in an existing open souce one. So here is a brand new url shortener built with ruby and a framework called Padrino.
Ruby
1
star
29

lets-learn-python-text-adventure

This is the first in hopefully a series of repositories to teach people that are close to me programming. In this repo I will be teaching python. I by no means am an expert at python but through the art of teaching im hoping to expand my knowledge base.
Python
1
star
30

kube-utils

Simple repo for useful sidecar cli tools. Useful for debugging.
Shell
1
star
31

fluxified

Fluxified Infrastructure
Python
1
star