Skip to main content
The PopLock API is a single file with no npm dependencies. Installation is a copy-and-configure process.

Prerequisites

  • Node.js available at /usr/bin/node
  • systemd for service management
  • openssl for key generation

Steps

1

Copy the application file

Copy the script to your system binaries directory:
2

Set up the config file

Copy the config template and lock down its permissions:
The config file contains your API key. Keep permissions set to 600 so only root can read it. Wider permissions expose your key to all local users.
3

Generate an API key

Generate a secure 32-byte hex string:
Open the config file in a text editor and replace REPLACE_WITH_YOUR_SECRET_KEY with the generated string:
The config file format is:
The port can be changed by setting PORT= in /etc/poplock-api.conf or by setting the PORT environment variable before starting the service. The default is 6767.
4

Install the systemd service

Before copying, open poplock-api.service and update the User and Group fields to match the system user that owns the Minecraft server directory:
poplock-api.service
Then copy the unit file, reload systemd, and enable the service so it starts on boot:
5

Verify it's running

Check the service status:
You should see active (running) in the output. The API will be listening on http://0.0.0.0:6767.