Giter VIP home page Giter VIP logo

docker-terraria's Introduction

Dockerized Vanilla Terraria Server

Build - Latest

Instructions

Set up two folders, one should be mounted to /world and contain your world files. The other should be mounted to /config and contain a single file: serverconfig.txt. This file is your server config file as described here. In your config file, make sure worldpath=/world and world=/world/<worldname>.wld. If you do not already have a world, you can use the autocreate option to make the server create the world. If you do not have a serverconfig.txt file, the container will create one for you that autocreates a medium world called "Terraria."

For security, you should set up a dedicated user and group for Terraria. Grant permissions on the two folders to that user/group, and record the uid/gid.

Run the container via the CLI with: docker run -itd --name=terraria -e PUID=<PROCESS UID> -e PGID=<PROCESS GID> -p 7777:7777 -v <PATH TO WORLDS>:/world -v <PATH TO CONFIG>:/config kaysond/docker-terraria Replacing the items in <>. For paths, I use /var/lib/terraria/world and /var/lib/terraria/config.

You can also use the following docker-compose.yml file, and run with docker-compose up -d.

version: '2.0'

services:
  terraria:
    container_name: terraria
    image: kaysond/docker-terraria
    environment:
      PUID: "<PROCESS UID>"
      PGID: "<PROCESS GID>"
    restart: always
    stdin_open: true
    tty: true
    ports:
      - 7777:7777
    volumes:
      - <PATH TO WORLDS>:/world
      - <PATH TO CONFIG>:/config

If you want to use the interactive console, you can re-attach to the container via docker attach terraria.

Sample serverconfig.txt

world=/world/World.wld # Do not change this unless you have a world file that has already been created
autocreate=2 # Auto create a medium size world if /world/World.wld doesn't exist
worldpath=/world # Auto create will save the world file to <worldpath>/World.wld
worldname=Terraria
difficulty=0 # Sets the difficulty of the map ; 0=Normal ; 1=Expert ; 2=Master ; 3=Jorney

docker-terraria's People

Contributors

kaysond avatar 7antoine7 avatar barrelmaker97 avatar blackerking avatar bmameli avatar wlfio avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.