Page 1 of 1
Raspberry 5 headless server
Posted: Thu Oct 24, 2024 11:00 am
by Maroxis
I've been hosting space age on my raspberry for last couple days and I must say, the performance has been rock solid for now.
We are already at stage when we are launching first rocket and there has been no issues yet. I've been using box64 emulator to run it.
Has anyone else tried to run server on raspberry? How far can you go before getting any issues?
Also does anyone know better way to update the headless server than re-downloading it and unpacking it manually every time? Auto updater would be a +
Re: Raspberry 5 headless server
Posted: Thu Oct 24, 2024 6:48 pm
by Hamster
Wow, never thought to run factorio on PI, which device do you have?
Re: Raspberry 5 headless server
Posted: Sun Oct 27, 2024 12:54 am
by Maroxis
I got Pi 5 8GB, but in terms of memory you could probably host headless with just 2.
We made some progress and we got to space/alien science on 2/3 closest planets. I've seen CPU usage max around 70% so I don't think It will be able to run to the endgame, but so far no issues.
Re: Raspberry 5 headless server
Posted: Wed Jan 01, 2025 1:30 am
by xxxjchrist
Maroxis wrote: ↑Thu Oct 24, 2024 11:00 am
I've been hosting space age on my raspberry for last couple days and I must say, the performance has been rock solid for now.
We are already at stage when we are launching first rocket and there has been no issues yet. I've been using box64 emulator to run it.
Has anyone else tried to run server on raspberry? How far can you go before getting any issues?
Also does anyone know better way to update the headless server than re-downloading it and unpacking it manually every time? Auto updater would be a +
You probably figured this one out by now, but i wrote a simple .sh script for it..
Ubuntu:
Code: Select all
#!/bin/bash
# Define variables
TMP_DIR="/tmp"
DOWNLOAD_URL="https://factorio.com/get-download/stable/headless/linux64"
ARCHIVE_NAME="factorio.tar.xz"
ARCHIVE_PATH="$TMP_DIR/$ARCHIVE_NAME"
EXTRACT_PATH="/opt/factorio"
DOCKER_CONTAINER="fd"
# Step 1: Download the latest headless version of Factorio
echo "Downloading the latest headless version of Factorio..."
if curl -sSL -o "$ARCHIVE_PATH" "$DOWNLOAD_URL"; then
echo "Download complete: $ARCHIVE_PATH"
else
echo "Error: Failed to download Factorio. Check the URL or network connection."
exit 1
fi
# Step 2: Extract the archive to /opt, forcefully overwriting existing files
echo "Extracting Factorio to $EXTRACT_PATH..."
if mkdir -p "$EXTRACT_PATH" && tar -xJf "$ARCHIVE_PATH" --strip-components=1 -C "$EXTRACT_PATH"; then
echo "Extraction successful: $EXTRACT_PATH"
else
echo "Error: Failed to extract Factorio to $EXTRACT_PATH. Check permissions or archive integrity."
exit 1
fi
# Step 3: Restart the Docker container
echo "Restarting Docker container '$DOCKER_CONTAINER'..."
if docker restart "$DOCKER_CONTAINER" &>/dev/null; then
echo "Docker container '$DOCKER_CONTAINER' restarted successfully."
else
echo "Error: Failed to restart Docker container '$DOCKER_CONTAINER'. Ensure Docker is running and the container exists."
exit 1
fi
# Step 4: Provide final status
echo "Factorio update process completed successfully!"
echo "You can now run Factorio from: $EXTRACT_PATH"
Or
Debian:
Code: Select all
#!/bin/bash
#===============================================================================
# This script downloads the latest Factorio headless server tarball,
# extracts it into /opt/factorio, and restarts a specified Docker container.
#
# Compatible with Debian-based distributions (e.g., Ubuntu, Debian).
#
# Usage:
# 1. Make the script executable: chmod +x factorio_update.sh
# 2. Run it (as root or via sudo): ./factorio_update.sh
#
#===============================================================================
# --- Configuration Variables ---
TMP_DIR="/tmp"
DOWNLOAD_URL="https://factorio.com/get-download/stable/headless/linux64"
ARCHIVE_NAME="factorio.tar.xz"
ARCHIVE_PATH="$TMP_DIR/$ARCHIVE_NAME"
EXTRACT_PATH="/opt/factorio"
DOCKER_CONTAINER="fd"
# --- Step 1: Download the latest headless version of Factorio ---
echo "Downloading the latest headless version of Factorio..."
if curl -sSL -o "$ARCHIVE_PATH" "$DOWNLOAD_URL"; then
echo "Download complete: $ARCHIVE_PATH"
else
echo "Error: Failed to download Factorio. Check the URL or network connection."
exit 1
fi
# --- Step 2: Extract the archive to /opt, overwriting existing files ---
echo "Extracting Factorio to $EXTRACT_PATH..."
if mkdir -p "$EXTRACT_PATH" \
&& tar -xJf "$ARCHIVE_PATH" --strip-components=1 -C "$EXTRACT_PATH"; then
echo "Extraction successful: $EXTRACT_PATH"
else
echo "Error: Failed to extract Factorio to $EXTRACT_PATH. Check permissions or archive integrity."
exit 1
fi
# --- Step 3: Restart the Docker container ---
echo "Restarting Docker container '$DOCKER_CONTAINER'..."
if docker restart "$DOCKER_CONTAINER" &>/dev/null; then
echo "Docker container '$DOCKER_CONTAINER' restarted successfully."
else
echo "Error: Failed to restart Docker container '$DOCKER_CONTAINER'."
echo "Ensure Docker is running and the container exists."
exit 1
fi
# --- Step 4: Provide final status ---
echo "Factorio update process completed successfully!"
echo "You can now run Factorio from: $EXTRACT_PATH"
The name of my Docker container with Factorio Server Manager starts with 'fd' hence the restart of the named container, but you should be able to modify this script accordingly to your setup with the bulk of it being the download and overwrite of the /opt/factorio directory. Good luck!!
Re: Raspberry 5 headless server
Posted: Wed Jan 01, 2025 2:58 pm
by NineNine
Can I ask if there's a particular reason to use a Raspberry Pi as a server? Used/refurbished computer hardware is so cheap, it's almost free in most parts of the world. Are you just doing it to see if it can be done?
Re: Raspberry 5 headless server
Posted: Wed Jan 01, 2025 3:38 pm
by Daid
NineNine wrote: ↑Wed Jan 01, 2025 2:58 pm
Can I ask if there's a particular reason to use a Raspberry Pi as a server? Used/refurbished computer hardware is so cheap, it's almost free in most parts of the world. Are you just doing it to see if it can be done?
There is no reason. There used to be the reason that it was quite easy to go fanless. But they threw that out of the window. A 2nd hand thin client is cheaper and more powerful. And in the case of Factorio, you don't have to deal with an emulation layer from ARM to AMD64.
Re: Raspberry 5 headless server
Posted: Wed Jan 01, 2025 5:32 pm
by adam_bise
I think your Pi will be brought to its knees as your bases approach 50+ SPM
Re: Raspberry 5 headless server
Posted: Wed Jan 01, 2025 6:28 pm
by rollc_at
Also does anyone know better way to update the headless server than re-downloading it and unpacking it manually every time? Auto updater would be a +
Look into Docker, or more specifically:
https://github.com/factoriotools/factorio-docker
I'm not sure what's the current story with running x86_64 containers on arm64. IIRC there was some work underway to integrate transparent CPU emulation, since many people just copy-pasted Qemu into their arm64 Dockerfiles.
I wish there were official Factorio arm64 builds for Linux, especially considering both arm64 Mac (+Switch) and x86_64 Linux are supported.
Can I ask if there's a particular reason to use a Raspberry Pi as a server? Used/refurbished computer hardware is so cheap, it's almost free in most parts of the world. Are you just doing it to see if it can be done?
Arm64 in general has been steadily making progress not just in performance per watt, but performance in general. Billions of smartphones = economies of scale; then Apple proved it's also viable for laptops&desktops, and Ampere - for high-end servers.
I'm using my M1 Mac mini as a home server AND desktop; and if there was a headless Mac build, I'd use it as a 24/7 Factorio server, because the machine has power to spare - and draws 4-6W idle.
As for the RPi5 (supposedly 2-3x improvement over RPi4), I can't tell you because I haven't had one in my hands yet, but my homelab is full of RPi4's and NVidia Jetsons doing various odd jobs. They're not just good overall, but they also don't suck dust, blast heat, or take 4U's of rack space each.