-
Notifications
You must be signed in to change notification settings - Fork 0
/
valheim-setup.sh
37 lines (28 loc) · 1.17 KB
/
valheim-setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
sudo timedatectl set-timezone America/Sao_Paulo
sudo apt update
sudo useradd steam --create-home --shell /bin/bash
# sudo usermod -aG google-sudoers steam
mkdir -p /home/steam/valheim
sudo chown steam:steam -R /home/steam
curl https://get.docker.com | sh
sudo systemctl enable docker
sudo systemctl start docker
sudo usermod -aG sudo steam
sudo usermod -aG docker steam
# For a restore get the latest backup name on bucket
# and uncomment the lines below:
# chmod +x restore-backup.sh && \
# ./restore-backup.sh gs://example-world-bucket/backups/ example-worlds-00000-00000.zip
sudo docker run -d --restart always\
--name valheim-server \
--cap-add=sys_nice \
--stop-timeout 120 \
-p 2456-2457:2456-2457/udp \
-v /home/steam/valheim/restore/worlds:/config/worlds \
-v /home/steam/valheim/config:/config \
-v /home/steam/valheim/data:/opt/valheim \
-e SERVER_NAME="No Naked Vikings Allowed" \
-e WORLD_NAME="The Vik Zon" \
-e SERVER_PASS="" \
lloesche/valheim-server
# (crontab -l ; echo "0,30 * * * * gsutil -m rsync -d -r /home/steam/valheim/config/backups gs://valheim-world-backup/backups-sp &>> /home/steam/valheim/cron-backup.logs") | crontab -