Basic configuration
Now that the files have been installed, let's configure the core aspects of PteroCA.
Pterodactyl Configuration
To enable server management features like console access, statistics monitoring, and server startup configuration, you need to first configure Pterodactyl's allowed origins. This is a crucial security setting that controls which domains can interact with your Pterodactyl installation.
Configure Allowed Origins
Open the Pterodactyl configuration file:
Find or add the allowed_origins
parameter and set it to your PteroCA domain or IP address:
Save the file and exit the editor.
Security Considerations
When configuring allowed_origins
:
Using your specific domain or IP is the most secure approach
The wildcard (
*
) allows connections from any domain, which may pose security risksFor production environments, it's recommended to use only your specific domain/IP
Use wildcard only during testing or in fully controlled environments
Install PteroCA Plugin
Navigate to Pterodactyl's root directory and install the required PteroCA plugin using Composer:
This plugin is essential as it enables the creation of Client API Keys through the API interface, which is not possible with standard Pterodactyl installation. Client API Keys are required for proper server management functionality.
Create Pterodactyl API Key
To integrate PteroCA with your Pterodactyl installation, you need to generate an API key in the Pterodactyl panel. This API key is essential for enabling seamless server management and interaction between PteroCA and Pterodactyl.
Steps to Create an API Key:
Log in to your Pterodactyl panel.
Navigate to Admin -> Application API.
Click on Create New.
Select all read & write permissions to ensure PteroCA has the necessary access.
Set a description for the API key to help identify its purpose.
Click Create Credentials.
Copy and securely store the generated API key. You will need this key during the configuration of PteroCA.
Web Server Configuration
To configure your web server, you will need to create a configuration file and add your domain. Below is an example of how to configure NGINX for PteroCA.
Create the configuration file pteroca.conf
and place it in /etc/nginx/sites-available/
.
Example NGINX Configuration
The provided configuration uses php8.2-fpm.sock
. If you are using a different PHP version (e.g., PHP 8.3), make sure to update the fastcgi_pass
directive accordingly. For example:
Failure to adjust this may result in NGINX not starting correctly.
Replace YOUR.DOMAIN.COM
with your actual domain name. If you are using this configuration for local development, you can use a placeholder like localhost
or a custom local domain.
Enable Configuration
After configuring your web server, you will need to enable the NGINX configuration and restart the service.
Adding SSL
For SSL, a simple solution is using Certbot from Let's Encrypt. Certbot will automatically manage your SSL certificates and keep them up to date.
Database Setup
Create database and user with privileges
To create a database and a database user, follow the example below. This guide is for MariaDB. Remember to replace YOUR_PASSWORD
with your own secure password. Also, 127.0.0.1
refers to localhost. We recommend having basic Linux knowledge before attempting this.
Configure connection
Run the command
To begin configuring your database, execute the following command from the root directory of your project:
Follow the Interactive Prompts
The command will ask a series of questions to help configure your database:
Configure Database: The first question asks if you want to configure the database. By answering "yes", you will proceed to set up the database credentials.
Set Database Credentials: You will be prompted to enter the following details:
Database host (default:
localhost
)Database port (default:
3306
)Database name
Database user
Database password
These values will be written to your
.env
file under theDATABASE_URL
parameter.Run Migrations: After configuring the database credentials, the command will ask if you want to run migrations. By answering "yes", the system will execute migrations automatically in your database.
System configuration
Now that you've successfully configured the database, it's time to configure the system settings. This step is essential to ensure that the system functions smoothly, including setting up the site’s basic settings, email configuration, Pterodactyl panel credentials, payment settings, and creating the initial admin user.
This configuration can be managed through a built-in Symfony console command, which will guide you interactively through the setup process.
Before proceeding, ensure that you have a database and a database user set up with the correct permissions.
Configuration with Command
To streamline the system configuration process, use the following Symfony console command from your project root directory:
This command will guide you through the following steps:
System Settings Configuration: You will be prompted to configure core system settings such as:
Site URL: This defines the base URL of your application.
Site Title: The title of your site, which will be used throughout the application.
Locale: Set the default locale for the application (e.g.,
en
,fr
,de
).
Email Configuration: Next, the command will ask you to set up email-related settings. These settings are essential for the system to send emails such as notifications and password resets:
SMTP Server: The address of your SMTP server (e.g.,
smtp.mailtrap.io
).SMTP Port: The port to be used by the SMTP server (typically
587
or465
for secure connections).SMTP Username and Password: Credentials for authentication with the SMTP server.
SMTP From (Email): The email address from which system emails will be sent.
Pterodactyl Panel Integration: Application integrates with Pterodactyl (a game server management panel). The command will prompt you to enter:
Pterodactyl Panel URL: The URL where your Pterodactyl panel is hosted.
Pterodactyl API Key: The API key that allows your application to communicate with the Pterodactyl panel. Paste the API key you created in the previous section here.
Payment Configuration: Application handles payments and transactions. You will be asked to configure payment settings:
Stripe Secret Key: The secret key for interacting with the Stripe API.
Currency Name: The primary currency for your transactions (e.g.,
USD
,EUR
).Internal Currency Name: The name of the internal currency, which could be used for managing user balances within the system.
User Account Creation: After configuring the system settings, you will be prompted to create an initial admin user for the client area. This admin user will have full access to the system and can manage users, settings, and other aspects of the application:
Admin Email: The email address for the admin user.
Admin Password: A secure password for the admin user.
The system will automatically create this user and ensure that you have immediate access to the client area.
Default Settings: The system will automatically apply some default settings based on your inputs. If needed, you can customize these settings later by accessing the admin panel or modifying the database directly.
Example workflow
Here’s an example of what the system configuration process might look like:
Important notes
Running the Command Multiple Times
If you need to reconfigure the system, you can run the app:configure-system
command multiple times. The command is safe to run and will allow you to overwrite existing settings if needed.
Admin User Ensure that you create a secure admin user during the setup process. This user will have full access to the system, so use a strong password and secure email address.
Last updated