Skip to content

Terraform project for deploying a Terraria server

Notifications You must be signed in to change notification settings

yi-jiayu/terrariaform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraria server

Terraform project for deploying a Terraria server running TShock on DigitalOcean

Prerequisites

You should have:

  1. Terraform already set up (https://learn.hashicorp.com/terraform/getting-started/install.html)
  2. A DigitalOcean personal access token (https://www.digitalocean.com/docs/api/create-personal-access-token/)

Quickstart

  1. Create a new SSH key pair called id_terraria: ssh-keygen -f id_terraria -t ed25519 -N '' -C ''
  2. Run terraform init.
  3. Copy terraform.tfvars.template to terraform.tfvars: cp terraform.tfvars.template terraform.tfvars.
  4. Add your DigitalOcean personal access token to terraform.tfvars.
  5. Run terraform apply. This will output the server's IP address when complete.
  6. Monitor the server setup using ssh -i id_terraria terraria@$(terraform output ip) tail -f /var/log/cloud-init-output.log. The setup is complete once you see a line starting with Cloud-init ... finished.
  7. At this point, TShock should have started and will take some time to create a new world.
  8. Launch Terraria and connect to the server at its IP address on port 7777.

Managing your server

To connect to the server, run ssh -i id_terraria terraria@$(terraform output ip) from the project directory.

To interact with the TShock process, run screen -r tshock on the server. You can do this to see the auth code for becoming a super admin.

Hit Control + A and then D to detach from the screen without stopping the TShock process.

About

Terraform project for deploying a Terraria server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages