For more instructions and setup go to Valheim on AWS BlogPost
The following/requirements are needed.
- Access to AWS account with access credentials avaliable for use, AWS Docs
- VsCode installed
- NodeJs installed
- AWS Command Line Interface installed
- AWS SAM CLI installed
- Following github repo downloaded Valheim Server
- Discord WebHook
-
Install required packages using npm install.
-
Edit the configuration section in
./ci/scripts/deploy.sh
-
Change the deployment region to preferred region, change server name (this will be a searchable item in Valheim server browser)
-
Insert Discord WebHook
-
Run ./ci/scripts/deploy.sh
-
Goto secrets mananager and edit associated secret, will be the same as your server name
-
To start server run
aws lambda invoke --function-name ${serverName}-start /dev/stdout
, will take a few minutes to boot up, you will recieve a discord notification on server starting, and when the server is ready to connect -
A Cloudwatch alarm is used to auto shutdown the server after 30 minutes of inactivity, a discord notification is sent. For more infomation visit the blog
-
To manually stop the server run
aws lambda invoke --function-name ${serverName}-stop /dev/stdout
-
Connect to server using the serverName, searching in the valheim server logs
If however there is a issue, you can connect directly with an IP address.
In AWS, got to : elastic container service/<serverName>/Tasks/<select first task>/netowrking/PublicIp
Further work is needed to automatically retrieve the IP address, this will be implemented alongside the discord bot.