Just another Terraria server for Docker. ( v1.4.5.8 PC ) ( v1.4.0.5 MOBILE deprecated )
2.2K
Just another Terraria server for Docker
Supports the PC and the (deprectaed) MOBILE version.
A plain and simple Terraria server in a Docker container.
Can also be deployed in a Synology NAS (Intel CPUs only).
Actually, that's what I created it for :)
Make sure to specify different save locations for the PC and Mobile versions!
The worlds are not compatible.
BACKUP YOUR DATA
Terraria server 1.4.5.8 PC and MOBILE (crossplay)
Terraria server 1.4.0.5 MOBILE (OLD, DEPRECATED)
- updated for Terraria 1.4.5.8 release
- updated for Terraria 1.4.5.6 release
- updated notes for Synology
- fixed terraria.txt (server config)
- added server config note in readme
- added autocreate of a small "terraria.wld"
- fixed missing mc lib (for Dockerraria starting in "BASH" mode)
- some typos less now
- updated for Terraria 1.4.5.5 release
- updated for Terraria 1.4.3.6 release
- fixed bug: Terraria config file was ignored with new startup control
- added some notes for desktop computers
- updated for Terraria 1.4.2.2 release
- added a server for the MOBILE version 1.4.0.5
- added startup control via environment variables
- updated for Terraria 1.4.1.2 release
- updated for Terraria 1.4.1.1 release
- updated for Terraria 1.4.0.5 release
- updated terraria.txt (server config)
- updated for Terraria 1.4.0.4 release lol
- updated for Terraria 1.4.0.3 release
- added Journey's End template variables to terraria.txt (server config)
- updated for Terraria 1.4.0.2 release
Tested with new and updating several 1.3 worlds. Seems to work fine.
Anyway, creating a backup of your worlds or picking a different mounting directory is recommended.
"Just in case" [tm]
- renamed the Github and Docker hub repos to sth - well, "meaningful"
- major cleanup
- Terraria server configuration file not enabled by default
- added 'bash' option
- added a cow
- added automated build from Docker Hub
- initial version
As of v1.4.5, Terraria support crossplay. The dedicated MOBILE version is now depricated,
but I'll leave it in here (as long as the Terraria web site delivers the old binaries).
Notice that the Mobile devices need to connect via the "Online" button and not "Local". Just add the local IP address of your server or Synology NAS.
As long as you are on the same local network, nothing else is required and there is no
need to open or forward ports in your (Internet) router.
This is only required if you want to connect to your "server at home" from anywhere in
the world.
In this special case, it's usually required to forward the external port 7777 to port 7777 of your local server's or Synology's IP address.
Please consult the manual of your router on how to do this.
It's not hard to do, but also might expose your network to some security risk if you don't
know what you're doing. If in doubt, don't do it.
As an alternative and if you are the only one playing on your server or Synology, an OpenVPN connection with certificate is a much better option.
As of 26.11.2020, a new startup mode selection via environment variables was built in.
These can either be set with "-e" added to the Docker "run" command, e.g.
docker run --rm -it -p 7777:7777 -e STARTMODE=MOBILE fmmt666/dockerraria
docker run --rm -it -p 7777:7777 -e STARTMODE=PC fmmt666/dockerraria
or in the Synology "Environment" tab, e.g.:
Variable | Value
-------------+-------------
STARTMODE | MOBILE
For now, the following variables are supported:
STARTMODE set to
PC -> Start server in PC mode
MOBILE -> Start server in MOBILE mode
BASH -> Login and run bash. For debugging only.
If STARTMODE is not defined, Dockerraria will run in the "old" compatibility mode.
This is documented below.
IT IS HIGHLY RECOMMENDED TO USE DIFFERENT VOLUMES FOR THE PC AND THE MOBILE VERSION!
THE TWO VARIANTS ARE NOT COMPATIBLE AND MIGHT DESTROY YOUR WORLD FILES.
BACKUP YOUR DATA BEFORE CHANGING THE START MODES!
BACKUP YOUR DATA BEFORE CHANGING THE START MODES!
BACKUP YOUR DATA BEFORE CHANGING THE START MODES!
As of 11/2020, it is recommended to use the new startup method via environment variables:
For the old method and only for the PC variant (not necessary if you already set the STARTMODE variable above):
Start the container.
After a while, go to "Container" and the "Details" of the running container and follow the instructions in the "Terminal" tab.
Warning: The Synology web app tends to crash (at least Firefox),
while the world is generated. Those hundreds of lines with server
messages is just too much for this GHz CPU, lol...
One solution is to quickly leave the "Terminal" tab, after initiating the world building process
and come back after 3..4 minutes.
Warning: If containers are cloned, there's no possibility to change the parameters for the entry point.
Check by right clicking the old container and then selecting "details".
This should show something like:
Execution Command: runthis.sh
If there are any (older) parameters after the "runthis.sh", e.g.
Execution Command: runthis.sh config
you have to create a new container from scratch.
All those parameters will be added to the server line, and the server does not like double, or wrong entries.
For Synology, it's recommended to exclusively make changes in the exposed server file.
This will not work on Apple Silicon Macs, only Intel is supported.
But you're probably not here bc of that.
For Linux or Windoze though:
Get the Docker image from the Docker hub:
docker pull fmmt666/dockerraria
Quick test, notice that the generated world will not be saved:
docker run --rm -it -p 7777:7777 -e STARTMODE=PC fmmt666/dockerraria
docker run --rm -it -p 7777:7777 -e STARTMODE=MOBILE fmmt666/dockerraria
Or with the "old" method:
docker run --rm -it -p 7777:7777 fmmt666/dockerraria config
And follow the instructions.
to be continued ...
To store the world, add existing ones or change the default server configuration file,
you can either mount a Docker volume or a local directory (preferred variant).
Notice that the path to the directory needs to be an absolute; relative ones will not work.
By default and as pre-programmed in the config file, the files are internally (in Docker) stored in
/terraria <- config file
/terraria/worlds <- world files
The "directory notation", to map this internal directory to your computer is
-v <local, absolute path on your computer>:/terraria
E.g.:
docker run --rm -it -p 7777:7777 -v /home/hanswurst/terraria:/terraria -e STARTMODE=PC fmmt666/dockerraria
After starting the container, you now would find the files in here:
/home/hanswurst/terraria <- the default server config file will be available in here ("terraria.txt")
/home/hanswurst/terraria/worlds <- this is where the worlds will appear
To add existing worlds, just copy them to the above folder.
Additional command line arguments for the Terraria server can be added to the end of the line.
Skipping port and volume for visibility:
docker run --rm -it ... -e STARTMODE=PC fmmt666/dockerraria -world /terraria/worlds/superworld.wld
If everything is running fine, you can omit the --rm command, which deletes the container after execution.
docker run -it -p 7777:7777 -v /home/hanswurst/terraria:/terraria -e STARTMODE=PC fmmt666/dockerraria
By default, a prefilled server config, named "terraria.txt" is created in /terraria.
Existing files will not be overwritten. Good for you.
I renamed the file so you can keep existing, copied "serverconfig.txt" files as a reference in the same directory.
As of 2/2026, upon the first start, a new small world named "terraria.wld" will be created.
This might help you get going. As of then, the server config is yours ...
Notice that, if you already have an own "terraria.txt" in this location,
the file paths must match your installation. Otherwise, nothing will be saved
or strange things might happen.
to be continued ...
Have a nice day
FMMT666(ASkr)
Content type
Image
Digest
sha256:5a1d69b16…
Size
146.6 MB
Last updated
7 days ago
docker pull fmmt666/dockerraria