Basic configuration
Now that the files have been installed, let's configure the core aspects 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
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.
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