Skip to content

Setup HERA as a Service ​

To prevent the HERA server from shutting down after 2 hours, you should set up a service. To set up the HERA server as a service, you need SSH credentials for your Linux server. Then, enter the following information into the configuration file.

Start HERA as a Service ​

Create a file named HERA.service and edit it with a text editor. Replace [YOUR USERNAME] with the username you use to log in to the Linux server (for example, heraserver). Context: You should never log in as root on your server. Instead, create a separate user. This name is used for the login and must be entered in the appropriate places in the configuration. Enter the following content:

bash
[Unit]
Description=HERA Unreal Dedicated Server
After=network.target

[Service]
Type=simple

# The user account under which the server should run
User=[YOUR USERNAME]

# Base directory where your script is located
WorkingDirectory=/home/[YOUR USERNAME]/LinuxServer

# Your start script
ExecStart=/home/[YOUR USERNAME]/LinuxServer/HERA_Server.sh

# If the server crashes -> automatically restart
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Now you must place the HERA.service file in the following path:

bash
/etc/systemd/system/

Afterward, you can reload the new configuration file into the system:

bash
sudo systemctl daemon-reload

If you want to start the service automatically when the server boots—which is primarily relevant for server failures—you can do so with the following command:

bash
sudo systemctl enable HERA.service

Now you can start the service manually:

bash
sudo systemctl start HERA.service

If desired, you can stop the service with this command:

bash
sudo systemctl stop HERA.service

Or restart the service with:

bash
sudo systemctl restart HERA.service

Querying Status and Logs ​

You can check the current status of the service with the following command:

bash
sudo systemctl status HERA.service

You can easily exit this status display by pressing the Q key.

In the status display, you will see important information such as:

  • Active: Shows whether the service is running and how long it has been active

You can view the log stream separately. Here you will find all information from the application itself, such as users logging in or other errors and issues:

bash
journalctl -u HERA.service -f

You can terminate this log stream at any time with the shortcut CTRL+C.

If you want to check the number of automatic restarts so far, use this command:

bash
systemctl show HERA.service -p NRestarts

If you want to check all currently running programs on the system related to HERA:

bash
ps aux | grep -i HERA

You will receive a list of all programs including their process ID (PID)—for example, 335715. You can terminate the respective program with the kill command:

bash
kill 335715