Install a Factorio server

Deploy with Ansible, then connect from your Factorio client. This example uses Factorio 2.0.77, without Space Age.

1. Check prerequisites

Replace deploy and factorio.example.com below with your SSH user and server address. Check Docker on the server:

ssh deploy@factorio.example.com
sudo systemctl enable --now docker
sudo docker compose version
exit

2. Download and configure

On your control machine, download the Ansible deployment example. From the download directory, run:

mkdir factorio-deployment
unzip factorio-ansible.zip -d factorio-deployment
cd factorio-deployment
cp ansible/inventory.example.yml ansible/inventory.yml

Set your server address and SSH user in ansible/inventory.yml:

all:
  children:
    factorio:
      hosts:
        factorio-server:
          ansible_host: factorio.example.com
          ansible_user: deploy

Check ansible/defaults/main.yaml:

factorio_version: "2.0.77"
factorio_port: 34197
factorio_dlc_space_age: false

For Space Age, set factorio_dlc_space_age: true before the first deployment. Joining players need the expansion.

3. Deploy

On your control machine, from factorio-deployment:

ansible -i ansible/inventory.yml factorio -m ansible.builtin.ping
ansible-playbook -i ansible/inventory.yml ansible/deploy_factorio.yml --ask-become-pass

Enter your server's sudo password. Omit --ask-become-pass if you use passwordless sudo.

4. Check the server and get the password

Log in to the server:

ssh deploy@factorio.example.com
cd /home/factorio
sudo docker compose ps

Wait until the container reports healthy, then read the join password:

sudo docker compose exec factorio jq -r .game_password /factorio/config/server-settings.json

If startup fails, check the logs:

sudo docker compose logs --tail=100 factorio

5. Open the game port

Allow inbound UDP 34197 in the server and provider firewalls. If the server uses UFW:

sudo ufw allow 34197/udp

For internet access through a home router, forward UDP 34197 to the server's LAN address. If you changed factorio_port, use that port instead.

6. Connect and play

On your gaming computer:

  1. Start Factorio 2.0.77, or the version you configured on the server.
  2. Match the server's mods. For this vanilla setup, disable community mods, Space Age, Quality, and Elevated Rails.
  3. Choose Multiplayer → Connect to address.
  4. Enter factorio.example.com:34197. On the same LAN, use the server's LAN IP; over the internet, use its public IP or DNS name.
  5. Enter the join password from step 4.

Once the map loads, you're ready to play. Use Connect to address even on LAN: this server is not listed in the game browser.

Quick fixes

Back to Factorio