Deploy with Ansible, then connect from your Factorio client. This example uses Factorio 2.0.77, without Space Age.
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
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.
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.
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
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.
On your gaming computer:
factorio.example.com:34197. On the same LAN, use the server's LAN IP;
over the internet, use its public IP or DNS name.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.