What is an Egg?
An Egg is a JSON configuration file that defines:- Server installation process
- Docker images to use
- Startup commands and parameters
- Environment variables
- Configuration file parsing
- Stop commands
- Features and behavior
Egg Structure
Eggs use the export versionPTDL_v2 format:
Core Fields
Basic Information
name (string, required): Display name for the eggDocker Configuration
docker_images (object, required): Available Docker images for this eggStartup Configuration
startup (string, required): Command to start the server{{VARIABLE_NAME}}- User-defined variables{{SERVER_MEMORY}}- Allocated memory{{SERVER_IP}}- Server IP{{SERVER_PORT}}- Server port
File Deny List
file_denylist (array, optional): Files/directories that cannot be modified or deleted by usersFeatures
features (array, optional): Special features to enableeula- Shows EULA acceptance popup (Minecraft)fastdl- FastDL support (Source games)
Configuration Files
config.files
Defines how to parse and modify configuration files:properties- Java properties filesyaml- YAML configurationfile- Plain text replacementjson- JSON configurationxml- XML configuration
config.startup
Defines how to detect server state from console output:config.logs
Defines custom log parsing (optional):config.stop
Command to stop the server:^C- Send SIGINT (Ctrl+C)stop- Send “stop” commandend- Send “end” commandquit- Send “quit” command
Installation Script
The installation script runs in a separate container to set up the server:Available Variables
Installation scripts have access to:${STARTUP}- Startup command${SERVER_MEMORY}- Allocated memory${SERVER_IP}- Server IP${SERVER_PORT}- Server port- All user-defined variables
Installation Container
Use appropriate container for installation:ghcr.io/pterodactyl/installers:debian- Debian-basedghcr.io/pterodactyl/installers:alpine- Alpine-basednode:18-alpine- For Node.js apps- Custom containers as needed
Best Practices
- Always use absolute paths (
/mnt/server) - Check for errors and exit with non-zero code on failure
- Provide progress output for user feedback
- Clean up temporary files after installation
- Validate downloads with checksums when possible
Variables
Variables allow users to customize their servers:Variable Fields
name (string): Display name description (string): Help text for users env_variable (string): Environment variable name (uppercase, alphanumeric + underscore) default_value (string): Default value user_viewable (boolean): Can users see this variable? user_editable (boolean): Can users edit this variable? rules (string): Laravel validation rules Common validation rules:required- Must have a valuestring- Must be a stringinteger- Must be an integerboolean- Must be true/falsemin:N- Minimum value/lengthmax:N- Maximum value/lengthin:A,B,C- Must be one of the listed valuesregex:/pattern/- Must match regex pattern
Example: Custom Game Server Egg
Here’s a complete example for a custom game server:Importing Eggs
Via Admin Panel
- Navigate to Nests in the admin area
- Select the target nest
- Click Import Egg
- Upload your JSON file or paste the JSON
- Click Import
Via Command Line
Exporting Eggs
Export existing eggs to use as templates:- Navigate to the egg
- Click Export
- Save the JSON file
Testing Eggs
- Create a test server using the egg
- Verify installation completes successfully
- Check startup works correctly
- Test variables are applied properly
- Verify stop command works
- Test configuration parsing updates files correctly
- Check file deny list prevents editing protected files
Troubleshooting
Installation Fails
- Check installation script syntax
- Verify download URLs are accessible
- Ensure proper permissions on files
- Check container has required tools
Server Won’t Start
- Verify startup command is correct
- Check all variables are defined
- Ensure Docker image is appropriate
- Review server console output
Configuration Not Updating
- Verify parser type matches file format
- Check file paths are correct
- Ensure find/replace values are valid
- Confirm variables exist
Best Practices
- Use semantic versioning for egg updates
- Document variables clearly
- Provide sensible defaults for all variables
- Test thoroughly before deploying
- Use validation rules to prevent invalid input
- Keep installation scripts simple and well-commented
- Support multiple Docker images when applicable
- Follow naming conventions for variables (UPPERCASE_WITH_UNDERSCORES)
