Craftopia

Craftopia

Not enough ratings
Linux VPS Craftopia Dedicated Server Setup Guide
By Atara and 1 collaborators
A simple guide to setup a dedicated Craftopia server on a linux VPS, in as little as 15-20 minutes (with enough know how). I learned how to do all of this in a day with minimal previous linux and vps knowledge so most of you should be able to do it too.
   
Award
Favorite
Favorited
Unfavorite
Helpful Resources and Thanks
Here are the resources I used to help me figure out how to do this, they may help you as well:
https://www.vultr.com/docs/how-to-install-steamcmd-on-your-vps/
https://developer.valvesoftware.com/wiki/SteamCMD
https://www.reddit.com/r/Craftopia_/comments/q1rzng/would_it_be_possible_to_create_a_craftopia_server/hqshzlb/?utm_source=reddit&utm_medium=web2x&context=3
https://steamcommunity.com/sharedfiles/filedetails/?id=2525156012
https://seesaawiki.jp/craftopia/d/%c0%ec%cd%d1%a5%b5%a1%bc%a5%d0%a1%bc

Also a big thanks to Karenus from the official Pocketpair/Craftopia discord, and experienced_admin from the /r/webhosting discord for helping me troubleshoot some issues. Ben as well from the latter discord for providing me a hetzner vps referral link (20 euros credit).
Introduction, Preface and Requirements
There were no guides on how to do this yet, I could only find information on how to do this on windows so I didnt even know if this was possible. I figured I should give it a shot for fun anyways and host it on my home pc if it didnt work.

My first attempt was on a $7 AMD digital ocean droplet (1 vCPU core and 1gb ram), This failed spectacularly due to the lack of ram.
In search of a good value high performance VPS for cheap I settled on hetzner now that they have hosting in the states too, but vpsdime also has a good option at $7 a month. I tried the 2gb 2 vcpu core (amd) instance from hetzner as well but that one also gave me an out of memory crash. So I guess the minimum requirements is a 3+ GB ram VPS? I'm currently running on hetzners 3 vcpu core (amd) + 4gb ram instance with no issues. Everything has been working very smoothly so far. Maybe you can get away with less ram using a swap file, let us know if any of you try.

In this guide we will use Rocky Linux, but any Linux distro will work, check the links at the top of this guide to see instructions specific to your distro. RHEL and it's variants like Rocky Linux, AlmaLinux, CentOS, etc should all work with the same instructions.
Setting up your Linux VPS
Setup and deploy your VPS with whatever options or the bare minimum you need (you will at least need an ipv4 address), then figure out how to access it via a console or ssh using instructions from your vpn provider. This can be as easy as clicking an open console button from the vps hoster's website or running the "ssh root@yourvpsipaddress" from the windows terminal/cmd/powershell. My hoster provider sent me the password to login to root by email, and was prompted to change password on my first login.

First we want to make sure everything is updated. Run the following commands on your vps.
yum clean all yum update -y yum upgrade -y

Now you need to make sure you have a port open to accept inbound traffic for craftopia. Your vps provider should have instructions for this. In my case I just needed to add a firewall rule, I set port 6587 to allow UDP traffic. Surprisingly I only needed this one UDP port open, contrary to what other guides say.
SteamCMD and Server Files Installation
Now we will install steamcmd, which will let us download the craftopia dedicated server files.
First install the prerequisite software.
yum install glibc.i686 libstdc++.i686 -y

Then make a steam folder.
mkdir ~/Steam && cd ~/Steam

Now we download steamcmd.

If you get an error about tar, it might not be installed, run the following command then try to run the command from last step again.
yum install tar -y

Run steam cmd.
./steamcmd.sh

We want to set the install directory before doing anything.
force_install_dir ./craftopia_ds/

Then we login access the files we need.
login anonymous

Now we can install the server, to make sure you get the right version that will work with the current version of the game run this command. The "-beta public" shouldn't be needed on a fresh install, but I had issues without it.
app_update 1670340 -beta public

Then we want to exit steamcmd after it's finished downloading the craftopia server files.
exit

Change your directory to the server folder.
cd craftopia_ds

Then run the server once to generate a config file.
craftopia_ds//Craftopia.x86_64

Once the server is up and running, exit it with the stop command so we can go edit the config file.
stop
Server Settings Configuration
Now you want to edit server config file. See the links at the top of the guide for more info, but the info at the top of the config file will tell you enough. You can view the contents of the config file with cat instead of vi, but you will need vi or similar to edit it. There's also a DefaultServerSetting.ini in case you ever mess up your settings.
vi ServerSetting.ini

I suggest googling how to use vi to make this part easier. Hit the insert key to modify the text in the config file while in vi. You can enable a server password here and set the password. Main thing is to change bindipaddress to your server's ip address. You can also change the port you want your server to listen to for accepting inbound connections for craftopia, I left this as the default, 6587, just make sure whatever port you use is configured to accept inbound udp traffic (tcp and other ports arent needed) on your vps. Hit escape to go back to command mode in vi, then press colon : and enter wq to save the config and quit vi. I learned how to use vi while setting up my server from https://staff.washington.edu/rells/R110/#basics

Running and Connecting to your Server
That's it, it's that easy. You can run your server with
./Craftopia.x86_64
from whatever directory it's in (/Steam/craftopia_ds/ if you followed my guide), whenever you want, and leave it running if you like. Now you have a dedicated server on the "cloud" that you can connect to whenever you feel like it. It took me an entire day of trial an error to figure all this out, but following these steps to setup a fresh server after deleting my old one (cause I wanted to try cheaper VPS plans) it took literally 15-20 minutes from start to finish to get up and running without any issues. While the craftopia server software is running, you can use the
help -a
command to see all the available commands you have while the game server is running.

To connect to your server from your game just go to multiplayer, connect by ip, and enter your vps ip. If you're using the default 6587 port you shouldn't even need to specify the port, it will automatically be added to the end, but in case it doesnt you should enter your vps ip followed by a colon and the port number you opened, like so 0.0.0.0:0000, or 54.3.123.456:6587, etc. Anyone can connect to your server like this, unless you close connections or blacklist their ip from your server console (see the help command from earlier to see how).
Using an existing saved World
If you want to use an existing world save, on your pc go to C:\Users%USERNAME%\AppData\LocalLow\PocketPair\Craftopia\save and get the two .ocs files there (Craftopia.ocs and Settings.ocs), along with the "Worlds" folder. Delete the worlds you will not be using from that folder if there are multiple. Save these files and folder to the DedicatedServerSave folder on your VPS (should be /Steam/craftopia_ds/DedicatedServerSave/ or similar if you followed my guide).

I just had a friend zip up his files and send it to me on discord, which let me right click the download link and copy it. Then I used wget command from the vps to download it, example You can install unzip on your vps with
yum install unzip -y
Then run from your vps console
unzip yourfiles.zip
Delete original server save with
rm -rf (yourcraftopiaserverdirectory)/DedicatedServerSave
then replace it with the folder your extracted your save files to with unzip using the mv command. In my case it was something similar to
mv yoursavefiles Steam/craftopia_ds/DedicatedServerSave/

You could also do all this over sftp with an sftp client if you prefer to have an explorer/gui. Your vps provider should have instructions on how to sftp if you dont know how, or you can try following a generic guide online.
Download More Ram
We're not actually downloading more ram, but I wanted to suggest adding a swap file. A swap file is basically an extension of your system memory on your hard drive/ssd that can be used in place of your RAM, being especially useful in systems with low RAM, or not enough. In fact having a swap file may allow you to run a dedicated server on a VPS with less RAM (someone please let me know how it goes if they try this). I could not get the dedicated game server to run on a 2gb vps but you may be able to work with a swap file. For a 4gb VPS I suggest a 4gb+ swap file size, with a low swappiness (30 or less), I set mine to 10. For higher RAM VPS, you probably wont need a swap file at all, but it wouldnt be a bad idea to add a small one just in case, with a low swappiness value if it comes with fast nvme storage. You can get a way with larger swap files and higher swapiness if your vps has very good nvme disk performance. Here are instructions on how to make a swap file and set swappiness, these are the same ones I used for my Rocky Linux vps, and adding a swap file reduced the amount of server crashes we had by a lot. https://linuxize.com/post/create-a-linux-swap-file/

I also suggest enabling tuned and setting it the recommended profile for your vps, see here https://www.tecmint.com/tuned-automatic-performance-tuning-of-centos-rhel-servers/
For most VPS this will be virtual-guest, but for some VPS it will be atomic-guest, in which case I believe you need to install tuned-profiles-atomic if the profile isnt available for you to set already.
Footnote
PS it is recommended to make a separate user from root to do some of this on for security purposes. See the links at the top of the guide, they provide instructions on how if it matters to you.

If you're experienced with linux any, or webadmin stuff of this kind, you don't need to follow this guide exactly and will probably be able to figure your own way around things.

If you need any help or have any questions you can find or ping me on the official Craftopia discord @mim#7777. I probably wont check steam comments much.

Maybe I'll update this guide if needed with relevant corrections or additions.
1 Comments
ColdBrew Mar 17, 2024 @ 4:15pm 
Update, 2024.03.17

A few changes changed if you want to import your previous world from Windows to the server.

Instead of copying the files from the "Save" folder in AppData, copy from "PPSave", as "PPSave" is the new save format for worlds after the Seamless update.

Also, after importing your previous save to your Linux server, edit the "ServerSetting.ini" file and change "name" under [GameWorld] to match your world's name from Windows - if it doesn't match, the server will create a new world!

Other than that, this guide is perfect and still works great! :)