If you haven’t yet played Factorio, I think you should. Especially if you have any interest in logistics problems, circuit design, or coding. Sure, you don’t do any coding or circuit design in Factorio, but the main gameplay loop will have you tackling similar problems.

Enter DigitalOcean1. For ~$5 a month, you can have your own self-hosted Factorio server that can handle around ~5 concurrent players without and problems.

Let’s get started.

Setting up your Droplet

  1. Make an account on DigitalOcean and add your payment details to be able to create droplets2.
  2. Go to your “Droplets” page and click Create a New Droplet.
  3. Select Ubuntu 14.04 as your Droplet image.
  4. Select the $5 / month tier for your Droplet size.
  5. Select the closest datacenter region to where the majority of your players will be located.
  6. Enter a sensible name in the hostname box, and click create.
  7. Give DigitalOcean a few minutes to setup and configure your Droplet.
  8. Once configured, go into your Droplet and copy/record your IPv4 address. Digital Ocean Panel
  9. Now you’ll need to SSH into your droplet:
    • Mac (& Linux): Open Terminal (it’s in your Utilities folder) and run

      ssh root@YOUR_IP_ADDRESS

    • Windows: Download and install PuTTY and follow this guide for setting up an SSH session at root@YOUR_IP_ADDRESS

  10. Check your email for the root password. DigitalOcean sends you an email with the default root password.
  11. Create a sensibly secure password when you are prompted to do so.

Setting up your Server

  1. Go to the Factorio Download Page for the headless server package and download the .tar.gz to your local machine.

  2. Now you’ll use SFTP to upload the server files to your Droplet.

    • Mac: Open a new Terminal. Run sftp root@YOUR_IP_ADDRESS.
    • Windows: Follow this guide to get a PSFTP shell running at root@YOUR_IP_ADDRESS. Login with your password.

    After getting into your Droplet with SFTP, run

    put /path/to/your/server/download/factorio_headless_x64_.X.X.X.tar.gz

    after filling in the correct file path and name for the server tar.gz that you downloaded in step 1. (This will be a local path on your computer, something like

    /Users/<YOUR_USERNAME>/Downloads/factorio_headless_x64_X.X.X.tar.gz

    if you’re on a Mac)

  3. Go back to your SSH shell. If you run ls you’ll see that the server tar.gz is in you’re root directory!

  4. Run tar -zxvf factorio_headless_x64_.X.X.X.tar.gz to unzip the server files.

  5. Run cd factorio to enter your server folder.

  6. Run ./bin/x64/factorio --create MAP to create a map named MAP3.

  7. Run nano start.sh and copy in the following code:

    #!/bin/sh
    ./bin/x64/factorio --latency-ms 150 --autosave-interval 2 --autosave-slots 10 --disallow-commands --start-server MAP
    

    (Of course, these settings can be customized to your liking. You can see all the available settings by running ./bin/x64/factorio --help)

  8. Type Ctrl-X then Y to save and exit nano.

  9. Run chmod +x start.sh to make start.sh executable.

Running your server

  1. Run ./start.sh to start your server. (Remember: When you first connect to your Droplet, you’ll need to do cd factorio to get into your server folder)
  2. Launch Factorio on your PC. Click Play -> Multiplayer -> Connect to Game.
  3. Paste in your newly minted IP (the same one as you used for SSH and SFTP), and you’re good to go!

Good luck, and have fun. Factorio is a super addicting, afternoon-consuming type of game, so get ready to spend a lot of time in this new server.


  1. Though I write about how to do this with DigitalOcean, you could easily run these same settings on AWS, or perhaps even a RaspberryPi with similar results. ↩︎

  2. ‘Droplets’ are DigitalOcean’s naming convention for server instances. ↩︎

  3. You can customize your map name, or upload a custom map to the /factorio/saves/ folder if you wish. ↩︎