Development using Docker
Setup a local development environment using Docker
This method only works on macOS or Linux. Windows is not supported.
This approach offers several advantages compared to Vagrant:
- Faster boot and initial setup times
- Easy viewing & resetting of server data
- Lower resource consumption
- Easy service management & viewing of logs
Prerequisites
- Latest version of NodeJS LTS
- pnpm (
npm install -g pnpm@latest
) - Git
- Docker Engine
- On Linux, see your distro's wiki or Docker's docs for setting up Docker alongside its services
- On macOS, OrbStack is recommended to provide Docker Engine, but Docker Desktop can be used instead
- If using Docker Desktop on macOS, install
docker-mac-net-connect
buildx
andcompose
Docker extensions- These are installed by default with OrbStack and Docker Desktop
Limitations
- Rootless Docker (Linux) is not supported
- To delete or modify server data on Linux, you'll need to use
sudo
as Docker creates the volume binds as root - If you move the repositories location, you'll need to reset the server data as paths are hardcoded in the container
Initial setup
-
Clone the Pyrodactyl panel repository
-
Install dependencies:
-
Build the project:
- Caches build results
- Uploads sourcemaps to Sentry
- Makes subsequent builds without code changes nearly instant
-
Initialize the Docker image:
pnpm build:docker:dev
- Installs PHP and system dependencies
- Configures the image for Pyrodactyl services
- This only needs to be done once unless PHP dependencies or the
Dockerfile
changes
-
Copy the
docker-compose.develop.yml
file todocker-compose.yml
, and adjust it carefully if needed -
Move onto general usage
General usage
Once you've completed the initial setup:
-
Run
pnpm compose
to startup the environment. If this is your first time running this, it'll take a second to pull and configure everything -
Run
pnpm dev:docker
to start a local development server- For a production preview, run
pnpm run ship
and its build will be hosted by Docker
- For a production preview, run
-
Access Pyrodactyl from http://localhost:3000/, and login using the default credentials of
[email protected]
andpassword
-
Once finished, you can stop Docker using
pnpm compose:down
Tips
Remote caching
Set up Remote Caching via Turbo for faster builds. Cached results allow production server builds to complete in milliseconds.
Database host
This method supports creating a database host out of the box, which allows you to create databases on servers for testing. To do this, navigate to http://localhost:3000/admin/databases, click Create New, and use the following settings:
Resetting server data
To irreversibly reset your Docker data:
-
Take the Docker compose down (
pnpm compose:down
) -
Enter the following command in your terminal (
sudo
is only required on Linux): -
Put the Docker compose back up again (
pnpm compose
) and server data should be recreated
Troubleshooting
Make sure you're not running into any known limitations.
General errors
Firstly, try the below:
- Ensure your
docker-compose.yml
is correct. You should've copied the exampledocker-compose.develop.yml
to this file - Reset your server data if your happy to do so
- Rebuild the Docker image (
pnpm build:docker:dev
)
If nothing above works, collect any errors from the following to aid in troubleshooting:
- The latest Laravel logs inside
./srv/logs
- The logs of the services (i.e. panel, Wings, database)
You can try searching these errors in the Pterodactyl Discord server as someone has likely already found a solution. However, DO NOT ask for support in the Pterodactyl Discord as they do not support Pyrodactyl and will not help you.
If you need to ask for help, ask in our Pyrodactyl Discord server.
Ports in use
Try killing any processes that could be using Pyrodactyl's ports, i.e. 8080, 2022, and 3000 by default, then run pnpm compose
again. However, if that won't work, try the below:
- If the issue is while starting a server, adjust the allocations in your node settings to other ports
- If the issue is while starting the compose, carefully adjust the
docker-compose.yml
's IP settings