How to install Pterodactyl on CyberPanel to run your own Minecraft server
If you’re looking to install your own Minecraft server using Pterodactyl on CyberPanel, you’re in the right place! This comprehensive guide will walk you through each step, from creating CNAME records to configuring your servers and databases. Follow along for a seamless and enjoyable gaming experience.
To install Pterodactyl on CyberPanel and run your own Minecraft server, follow these detailed steps. Before starting, ensure you have read and applied the instructions in the following articles:
Table of Contents
Step 1: Create CNAME Records on Your DNS
First, you need to create two CNAME records:
ServerAlias.Domain.com
NodeAlias.Domain.com
Step 2: Create Websites on CyberPanel
For each CNAME, create a website on CyberPanel:
- Go to
MAIN > Website > Create Website
- Fill out the following data:
- Select Package: Default
- Select Owner: admin (or any user you prefer)
- Domain Name:
ServerAlias.Domain.com
(use your domain, without “www”, in lowercase) - Email: your email address
- Select PHP: 8.0
- Click Create Website.
- Repeat for
NodeAlias.Domain.com
.
Step 3: Issue SSL Certificates
- Go to
MAIN > Website > List Websites
- Find the created websites and click Issue SSL.
- Wait for it to finish, then click Manage to confirm the certificate from Let’s Encrypt.
- Go to on the same page.
CONFIGURATIONS > Rewrite Rules
- For
ServerAlias.Domain.com
replace the text with:
RewriteEngine On
REWRITERULE ^(.*)$ HTTP://ServerAlias.Domain.com/$1 [P]
- For
replace the text with:NodeAlias.Domain.com
RewriteEngine On
REWRITERULE ^(.*)$ HTTP://NodeAlias.Domain.com/$1 [P]
- Click Save Rewrite Rules.
Step 4: Configure OpenLiteSpeed
Access the OpenLiteSpeed control panel:
- Go to
Server Configuration > External App
- Click the plus sign at the top right.
- Select Type: Web Server.
- Fill out the following data:
- Name:
ServerAlias.Domain.com
- Address: 127.0.0.1:802
- Max Connections: 60
- Initial Request Timeout (secs): 60
- Retry Timeout (secs): 60
- Click the floppy sign to save.
- Repeat the above steps for
NodeAlias.Domain.com
:
- Name:
NodeAlias.Domain.com
- Address: 127.0.0.1:8443
Step 5: Add Web Socket Proxy
- Go to
Virtual Hosts > Summary > Virtual Host List
- Click on
NodeAlias.Domain.com
. - Go to Web Socket Proxy.
- Click the plus sign and fill out:
- URI: /
- Address: 127.0.0.1:8443
- Click the floppy sign to save.
- Restart LiteSpeed by clicking the green circular arrow.
Step 6: Deploy Pterodactyl Docker Compose on Portainer
- Open the Portainer control panel.
- Click on local Environments.
- Click on Stacks in the left panel.
- Click Add stack and fill out:
- Name: pterodactyl
- In the “Web editor”, add the following Docker Compose script:
version: "3.8"
# This section declares the basic config of all of your Containers that are
# declared below as "services"
x-common:
database:
&db-environment
# You don't need to change these because it will not be exposed to the public.
MYSQL_PASSWORD: &db-password "password_here"
MYSQL_ROOT_PASSWORD: "password_here"
panel:
&panel-environment
#This is the URL that your panel will be on after being reverse proxied.
# set this to "https://yoursubdomain.yourdomain.yourdomainstld"
APP_URL: "https://<ServerAlias.Domain.com>"
# A list of valid timezones can be found here:
# http://php.net/manual/en/timezones.php
APP_TIMEZONE: "Etc/UCT"
APP_SERVICE_AUTHOR: "email@gmail.com"
# Mail is an optional Setup, I have the basic setup if you want to use a gmail
# account. You will need an App Password as the MAIL_PASSWORD field, not your
# gmail password. Uncomment the following lines to enable mail.
HASHIDS_SALT: "Play.MC-SmartCraft.com" # DO NOT CHANGE
HASHIDS_LENGTH: 8 # DO NOT CHANGE
#mail:
#&mail-environment
#MAIL_FROM: "youremail@gmail.com"
#MAIL_DRIVER: "smtp"
#MAIL_HOST: "smtp.gmail.com"
#MAIL_PORT: "587"
#MAIL_USERNAME: "youremail@gmail.com"
#MAIL_PASSWORD: ""
#MAIL_ENCRYPTION: "true"
services:
# Wings is the service that hooks into docker and actually creates your game
# servers,
wings:
image: ghcr.io/pterodactyl/wings:latest
restart: always
networks:
- ptero0
# These are the ports exposed by Wings, I don't recommend changing them.
ports:
- "8443:443"
- "2022:2022"
tty: true
environment:
TZ: "Etc/UCT"
# For ease of setup, this is going to use root user.
WINGS_UID: 0
WINGS_GID: 0
WINGS_USERNAME: root
# This is where docker will bind certain parts of container to your actual
# host OS. These locations will be used later.
volumes:
- "/var/run/docker.sock:/var/run/docker.sock" # DO NOT CHANGE
- "/var/lib/docker/containers:/var/lib/docker/containers" # DO NOT CHANGE
- "/opt/pterodactyl/wings/config:/etc/pterodactyl" # Feel free to change.
- "/var/lib/pterodactyl:/var/lib/pterodactyl" # DO NOT CHANGE
- "/var/log/pterodactyl:/var/log/pterodactyl" # DO NOT CHANGE
- "/tmp/pterodactyl/:/tmp/pterodactyl/" # Recommended not to change.
# It's a database. Not much else to explain.
database:
image: mariadb:10.5
restart: always
command: --default-authentication-plugin=mysql_native_password
volumes:
- "/opt/pterodactyl/panel/database:/var/lib/mysql"
environment:
<<: *db-environment
MYSQL_DATABASE: "panel"
MYSQL_USER: "pterodactyl"
# It's a CACHE database. Not much else to explain.
cache:
image: redis:alpine
restart: always
# Now the fun part. Your actual panel.
panel:
image: ghcr.io/pterodactyl/panel:latest
restart: always
# For NGINX Reverse Proxy, I will be using these ports for simplicity.
ports:
- "802:80"
- "4432:443"
# Links these containers together in a docker network.
links:
- database
- cache
# This is where docker will bind certain parts of container to your actual
# host OS. These don't really matter that much.
volumes:
- "/opt/pterodactyl/panel/appvar/:/app/var/"
- "/opt/pterodactyl/panel/nginx/:/etc/nginx/http.d/"
- "/opt/pterodactyl/panel/logs/:/app/storage/logs"
# Sets the config stuff
environment:
<<: [*panel-environment]
# <<: [*mail-environment]
DB_PASSWORD: *db-password
APP_ENV: "production"
APP_ENVIRONMENT_ONLY: "false"
CACHE_DRIVER: "redis"
SESSION_DRIVER: "redis"
QUEUE_DRIVER: "redis"
REDIS_HOST: "cache"
DB_HOST: "database"
DB_PORT: "3306"
# This is Wings' Network. We don't need much depth here, all you need to know, is
# that it allows the passthrough of the ports from Wings.
networks:
ptero0:
name: ptero0
driver: bridge
ipam:
config:
- subnet: "192.55.0.0/16"
driver_opts:
com.docker.network.bridge.name: ptero0
Update placeholders (MYSQL_PASSWORD
, MYSQL_ROOT_PASSWORD
, APP_URL
, APP_TIMEZONE
, APP_SERVICE_AUTHOR
) before deploying.
For “TIME ZONE” you can select your zone from here.
- Click Deploy the stack.
- Stop the “pterodactyl-wings-1” container in Portainer.
Step 7: Create an Admin User for Pterodactyl
- Access the VPS terminal with root privileges.
- Run the command:
sudo docker exec -it pterodactyl-panel-1 php artisan p:user:make
- Follow the prompts to create an administrator account.
Step 8: Open the Pterodactyl Control Panel
- Visit https://ServerAlias.Domain.com.
- Navigate to the admin panel.
- Create a location:
- Go to
MANAGEMENT > Locations
- Click Create New.
- Short Code: MainLocation (or any name you prefer).
- Click Create.
Step 9: Create a Node on Pterodactyl
- Go to
MANAGEMENT > Nodes
- Click Create New.
- Fill out:
- Name: MainNode (or any name you prefer).
- Location: MainLocation (Select location your created).
- Node Visibility: Public
- FQDN:
NodeAlias.Domain.com
(add node CNAME). - Communicate Over SSL: Use SSL Connection
- Behind Proxy: Behind Proxy
- Total Memory: 4096 (Add the total RAM space of the node).
- Memory Over-Allocation: 0 (Entering 0 will prevent creating new servers if it would put the node over the limit).
- Total Disk Space: 10240 (Add the total Disk space of the node).
- Disk Over-Allocation: 0 (Entering 0 will prevent creating new servers if it would put the node over the limit).
- Daemon Port: 443
- Daemon SFTP Port: 2022
- Click Create Node.
Step 10: Add Minecraft Ports to Node
- On the Allocation page, fill out:
- IP Address: 0.0.0.0
- Ports: 25565,19132,19133
- Click Submit.
Step 11: Connect Node to Wings Container
- Copy the node configuration from Pterodactyl.
- Access Webmin control panel and navigate to
Tools > File Manager
- Go to
/opt/pterodactyl/wings/config
- and create a new file named
config.yml
. - Paste the node configuration and add:
docker:
network:
interfaces:
v4:
subnet: 192.54.0.0/16
gateway: 192.54.0.1
- Save the file.
- Start the “pterodactyl-wings-1” container in Portainer.
Step 12: Connect Database Container to Pterodactyl
- Go to
MANAGEMENT > Databases
- Click Create New.
- Fill out:
- Name: MainDatabase (or any name you prefer).
- Host: pterodactyl-database-1 (name of database contener).
- Port: 3306
- Username: root
- Password: (from
MYSQL_ROOT_PASSWORD
in the stack configuration) - Linked Node: MainNode (Select node your created).
- Click Create.
Step 13: Open Minecraft Ports on CSF Firewall
- Go to CyberPanel control panel.
- Navigate to
Server > Security > Firewall > csf - ConfigServer Firewall > Firewall Configuration > IPv4 Port Settings
- Add the ports
25565,19132,19133
to TCP_IN. - Click Change and then Restart csf-ltd.
Step 14: Create a Minecraft Server on Pterodactyl
- Go to
MANAGEMENT > Servers
- Click Create New.
- Fill out:
- Server Name: FirstServer (or any name you prefer).
- Server Owner: your username
- Default Allocation: 25565
- Database Limit: 1 (or any number you prefer).
- Allocation Limit: 1 (or any number you prefer).
- Backup Limit: 1 (or any number you prefer).
- CPU Limit: 0 (set 0 for no limt).
- Memory: 2048 (or any number you prefer).
- Swap: -1 (set -1 for no limt).
- Disk Space: 10240 (or any number you prefer).
- Nest: Minecraft
- Egg: Paper (Choose server type you want).
- Docker Image: Java 21 (Choose the appropriate version of Java for the plugin).
- Click Create Server.
- Click the wrench icon next to the newly created server.
After agreeing to the terms and conditions, your Minecraft server will start and can be accessed via
ServerAlias.Domain.com
Enjoy managing and playing on your new Minecraft server!
Conclusion
In conclusion, install a Minecraft server using Pterodactyl on CyberPanel provides you with full control and customization. By following these steps, you can create an optimized server environment, ready for endless gaming adventures. Enjoy the experience of managing your server and bringing your Minecraft world to life!
In order to read the following explanation of this series, you can click on the following link How install MeshCentral on CyberPanel for your own remote desktop server
More:
- Understanding CDN WordPress Integration
- Install utilities on CyberPanel like Webmin, Docker, Portainer and Opening of the Openlitespeed Control Panel
- Boost Your Revenue with Local SEO for Businesses
- Ultimate Guide to VPS Hosting Benefits
- How to install Cyberpanel with OpenLiteSpeed on Ubuntu and basic Configuration
Leave a Reply
You must be logged in to post a comment.