# Automatic Installation

{% hint style="warning" %}
Please note, this project is currently in an early version (0.x.x) and may contain bugs. Use it at your own risk.
{% endhint %}

To facilitate a seamless installation experience, we've developed an **automated Bash installer** that streamlines the entire setup process.\
It automatically detects your operating system, installs all required dependencies, configures your environment, and deploys the **PteroCA panel** with minimal user input.

Additionally, the installer now offers **optional Pterodactyl Panel installation** — fully automated, including **default node creation**, **API key generation**, and **automatic integration** with PteroCA.\
This allows you to set up a complete, production-ready environment in a single run.

## 🎥 Video Guide

{% embed url="<https://www.youtube.com/watch?v=D5QtfMUAnt0>" %}

***

## 1. Execute the installer

{% hint style="success" %}
💡 **Now supports all-in-one setup!**\
The installer can now automatically install **PteroCA** and (optionally) the **Pterodactyl Panel** in a single run.\
It will also **fully configure Pterodactyl automatically** – including creating the **default node**, generating the **API key**, and importing both into PteroCA for instant integration.
{% endhint %}

{% hint style="info" %}
⚙️ **PteroCA Plugin for Pterodactyl**

If you’re using **your own existing Pterodactyl instance**, make sure the [**PteroCA Plugin**](/core-configuration/pterodactyl-integration/addon-installation.md) is installed.\
Without it, certain PteroCA integration features will not be available.\
📖 [Follow this guide](https://docs.pteroca.com/installation/installation/pages/J5GU7zgKOiNIh1rEhCIh#id-4.-installation) or [watch the video tutorial](https://www.youtube.com/watch?v=D5QtfMUAnt0) to install the plugin manually.

🧩 If you’re installing **Pterodactyl via our autoinstaller**, the plugin is **installed automatically** - no manual action required.
{% endhint %}

```bash
bash -c "$(wget -qO- https://pteroca.com/installer.sh)"
```

<details>

<summary>Requirements &#x26; Supported OS</summary>

**Operating System:** Ensure your server is running a supported OS:

* Ubuntu 24.04 (Noble)
* Ubuntu 22.04 (Jammy)
* Debian 13 (Trixie)
* Debian 12 (Bookworm)
* Debian 11 (Bullseye)
* Rocky Linux 10
* Rocky Linux 9
* Rocky Linux 8
* AlmaLinux 10
* AlmaLinux 9
* AlmaLinux 8
* CentOS Stream 10
* CentOS Stream 9

**Root Access:** The installation must be executed with root privileges.

{% hint style="warning" %}
**Recommended for fresh systems**: This installer works best on clean servers without existing web services or custom configurations. If you have existing services, consider using [Manual Installation](/installation/installation/manual-installation.md) to avoid potential conflicts.
{% endhint %}

</details>

### 1.1 Using Installer with Custom Parameters

If you prefer to run the installer manually or automate deployments (e.g. with Ansible, CI/CD, or VPS provisioning scripts), the Bash script supports advanced flags that allow full control over the installation process.

<details>

<summary>CLI Parameters Reference</summary>

**Required Parameters (when using `--yes` non-interactive mode)**

* `-p, --php-version <VERSION>` – PHP version to install (8.2, 8.3, 8.4)
* `-d, --domain <DOMAIN>` – Your panel's domain (e.g., panel.example.com) \[optional - if empty, uses port 80]
* `-m, --config-method <METHOD>` – Configuration method: `web` or `cli`

**General Flags**

* `--yes, -y` – Enables non-interactive mode (no questions asked)
* `--ssl` – Forces SSL certificate generation (domain must be live)
* `--no-ssl` – Skips SSL (no HTTPS setup)
* `--staging` – Uses staging Let's Encrypt certificates (for testing)
* `--disable-telemetry` - Disables telemetry data collection during and after installation

**Pterodactyl Installation Parameters**

* `--install-pterodactyl` – Installs Pterodactyl Panel alongside PteroCA
* `--pterodactyl-subdomain <SUBDOMAIN>` – Subdomain for Pterodactyl (e.g., panel.example.com)
  * If not provided, Pterodactyl will use port 8000
* `--pterodactyl-admin-email <EMAIL>` – Pterodactyl administrator email
* `--pterodactyl-admin-username <USERNAME>` – Pterodactyl administrator username
* `--pterodactyl-admin-password <PASSWORD>` – Pterodactyl administrator password

</details>

<details>

<summary>Usage Examples</summary>

**1. Basic PteroCA Installation (PteroCA only)**

```bash
bash installer.sh --yes \
  --php-version 8.3 \
  --domain pteroca.example.com \
  --config-method web \
  --ssl
```

**2. PteroCA Installation without Domain (localhost)**

```bash
bash installer.sh --yes \
  --php-version 8.3 \
  --domain "" \
  --config-method web \
  --no-ssl
```

**3. PteroCA + Pterodactyl (with Pterodactyl subdomain)**

```bash
bash installer.sh --yes \
  --php-version 8.3 \
  --domain pteroca.example.com \
  --config-method web \
  --ssl \
  --install-pterodactyl \
  --pterodactyl-subdomain panel.example.com \
  --pterodactyl-admin-email admin@example.com \
  --pterodactyl-admin-username admin \
  --pterodactyl-admin-password SecurePass123
```

**4. PteroCA + Pterodactyl (Pterodactyl on port 8000)**

```bash
bash installer.sh --yes \
  --php-version 8.3 \
  --domain pteroca.example.com \
  --config-method web \
  --ssl \
  --install-pterodactyl \
  --pterodactyl-admin-email admin@example.com \
  --pterodactyl-admin-username admin \
  --pterodactyl-admin-password SecurePass123
```

**5. Test Installation with Staging Certificates**

```bash
bash installer.sh --yes \
  --php-version 8.3 \
  --domain test.example.com \
  --config-method web \
  --ssl \
  --staging \
  --install-pterodactyl \
  --pterodactyl-admin-email admin@test.example.com \
  --pterodactyl-admin-username admin \
  --pterodactyl-admin-password TestPass123
```

</details>

<details>

<summary>Important Notes</summary>

* **Required in non-interactive mode (`--yes`):**
  * `--php-version`
  * `--domain` (can be empty `""` for localhost)
  * `--config-method`
* **Pterodactyl Installation:**
  * If you don't provide `--pterodactyl-subdomain`, Pterodactyl will be accessible on port 8000
  * Admin parameters (`--pterodactyl-admin-*`) are optional - if not provided, they will be auto-generated
* **SSL:**
  * `--ssl` requires a live domain pointing to your server
  * `--staging` is useful for testing (avoids Let's Encrypt rate limits)
  * Without `--ssl` or `--no-ssl`, the script will ask interactively
* **Domains:**
  * PteroCA and Pterodactyl **cannot** use the same domain
  * Valid configuration example:
    * PteroCA: `pteroca.example.com`
    * Pterodactyl: `panel.example.com` or port `8000`

</details>

***

## 2. Automatic Installation Process

{% hint style="info" %}
🧩 **Optional Pterodactyl Installation**\
During the setup, the script may ask whether you want to **install Pterodactyl Panel** alongside PteroCA.\
If you choose **`y` (yes)**, the installer will automatically handle the entire Pterodactyl setup — including all dependencies, configuration, **node creation**, and **API key generation** — and then import those details into PteroCA.\
The process closely mirrors the PteroCA installation flow, so you can follow the same steps confidently.
{% endhint %}

The script will guide you through the PteroCA installation process, allowing you to choose between two configuration methods:

* **Web Wizard** – A user-friendly web-based setup wizard that simplifies the configuration process.
* **CLI Wizard** – A fully interactive command-line setup for users who prefer a terminal-based approach.

Both methods will prompt you to enter essential details, including PHP version selection, domain configuration, [Pterodactyl API credentials](/core-configuration/pterodactyl-integration/api-configuration.md), and admin account credentials for PteroCA.

<details>

<summary>Example installation process workflow with Web Wizard</summary>

1. Run the installer:

```
root@test:~# bash -c "$(wget -qO- https://pteroca.com/installer.sh)"

Starting PteroCA installation... 
Detected OS: ubuntu 22.04 (jammy)

Available PHP versions:
1. PHP 8.2
2. PHP 8.3
3. PHP 8.4 

Select PHP version [1-3]: 1 
Selected PHP version: 8.2

Basic Configuration 
Enter your domain (e.g., panel.example.com): test.pteroca.com

Adding PHP repository... [...]
Adding MariaDB repository... [...]
Updating package manager... [...]
Installing dependencies... [...]
Installing Composer... [...]
Configuring services... [...]
Running mysql_secure_installation... [...]
Setting up database... [...]
Setting up PteroCA application... [...]
Cloning PteroCA repository... [...]
Installing Composer dependencies... [...]
Creating environment configuration... [...]
Verifying database connection... [...]
Executing PteroCA Database Migrations... [...]
Configuring PHP-FPM... [...]
Looking for PHP-FPM configuration... [...]
Configuring NGINX... [...]
Setting up SSL certificate... [...]
Setting up CRON jobs... [...]
Configuring PteroCA application... [...]

Select the initial configuration method:
1) Web Wizard (recommended)
2) CLI
Enter your choice [1-2]: 1

Web Wizard selected. Please complete the configuration via the web interface.
Open your browser and navigate to: https://test.pteroca.com/first-configuration}
 
Performing final checks...

PteroCA installation completed successfully!

Installation Summary:
Domain: test.pteroca.com
PHP Version: 8.2
OS: ubuntu 22.04
Panel URL: https://test.pteroca.com

Database Credentials:
Database Name: pteroca
Database User: pteroca
Database Password: [database password]
Database Host: localhost
MySQL Root Password: [mysql root password]

Credential Files:
MySQL Root Password: /root/.pteroca_mysql
Environment File: /var/www/pteroca/.env

Next Steps: Complete the Initial Configuration
The installation is complete, but you still need to configure your PteroCA instance.
To finalize the setup, please visit the Web Wizard and follow the instructions:
Open your browser and go to: https://test.pteroca.com/first-configuration


Important:
1. Save these credentials in a secure location
2. Configure your firewall to allow ports 80 and 443 (if needed)

Thank you for installing PteroCA!
```

2. Navigate to **`[yourdomain]/first-configuration`** in your browser. Select your preferred language and click **"Start"** to begin the setup process.<br>

   <figure><img src="/files/pEH56TUA5VHjzofpcJPN" alt="" width="188"><figcaption><p>Welcome page of web wizard</p></figcaption></figure>
3. Follow the guided steps to complete the configuration, providing details such as site settings, [Pterodactyl API credentials](/core-configuration/pterodactyl-integration/api-configuration.md), email configuration, and the credentials for the first admin account. If you encounter any issues filling in the required information, refer to the [System Configuration guide](/core-configuration/core-configuration.md) for assistance.
4. [Configure Pterodactyl and install PteroCA Plugin for Pterodactyl](/core-configuration/pterodactyl-integration.md)

</details>

<details>

<summary>Example installation process workflow with CLI wizard</summary>

1. Run the installer:

   ```
   root@test:~# bash -c "$(wget -qO- https://pteroca.com/installer.sh)"

   Starting PteroCA installation... 
   Detected OS: ubuntu 22.04 (jammy)

   Available PHP versions:
   1. PHP 8.2
   2. PHP 8.3
   3. PHP 8.4 

   Select PHP version [1-3]: 1 
   Selected PHP version: 8.2

   Basic Configuration 
   Enter your domain (e.g., panel.example.com): test.pteroca.com

   Adding PHP repository... [...]
   Adding MariaDB repository... [...]
   Updating package manager... [...]
   Installing dependencies... [...]
   Installing Composer... [...]
   Configuring services... [...]
   Running mysql_secure_installation... [...]
   Setting up database... [...]
   Setting up PteroCA application... [...]
   Cloning PteroCA repository... [...]
   Installing Composer dependencies... [...]
   Creating environment configuration... [...]
   Verifying database connection... [...]
   Executing PteroCA Database Migrations... [...]
   Configuring PHP-FPM... [...]
   Looking for PHP-FPM configuration... [...]
   Configuring NGINX... [...]
   Setting up SSL certificate... [...]
   Setting up CRON jobs... [...]
   Configuring PteroCA application... [...]

   Select the initial configuration method:
   1) Web Wizard (recommended)
   2) CLI
   Enter your choice [1-2]: 2

   Do you want to configure system settings? (yes/no) [yes]:
    > yes
    
   Do you want to set site settings? (yes/no) [yes]:
    > yes
    
   Site URL [http://localhost]:
    > https://test.pteroca.com
    
   Do you want to set email settings? (yes/no) [yes]:
    > no
    
   Do you want to configure pterodactyl panel credentials? (yes/no) [yes]:
    > yes
    
   Pterodactyl Panel URL [http://localhost]:
    > https://pterodactylexampleurl.com

   Pterodactyl Panel API Key []:
    > mypterodactylapikey
    
   Do you want to configure payment settings? (yes/no) [yes]:
    > no
    
   Do you want to create user? [yes]:
    > yes
    
   User e-mail []:
    > test@pteroca.com
    
   User password []:
    > TestPassword$
    
   Is user admin? (yes/no) [yes]:
    > yes
    
   Performing final checks...

   PteroCA installation completed successfully!

   Installation Summary:
   Domain: test.pteroca.com
   PHP Version: 8.2
   OS: ubuntu 22.04
   Panel URL: https://test.pteroca.com

   Database Credentials:
   Database Name: pteroca
   Database User: pteroca
   Database Password: [database password]
   Database Host: localhost
   MySQL Root Password: [mysql root password]

   Credential Files:
   MySQL Root Password: /root/.pteroca_mysql
   Environment File: /var/www/pteroca/.env

   Important:
   1. Save these credentials in a secure location
   2. Configure your firewall to allow ports 80 and 443 (if needed)

   Thank you for installing PteroCA!
   ```
2. [Configure Pterodactyl and install PteroCA Plugin for Pterodactyl](/core-configuration/pterodactyl-integration.md).

</details>

Based on your inputs, the script will:

* **Install Dependencies:** Set up necessary repositories and install required packages, including Nginx, PHP and MariaDB.
* **Configure Services:** Set up and secure the database, configure the web server, and ensure all services are running correctly.
* **Deploy PteroCA:** Download the latest version of PteroCA, configure environment settings, and set appropriate file permissions.

Upon successful installation, the script will provide: Access URL, Admin Credentials and Database Credentials.

{% hint style="info" %}
If your PteroCA instance is running behind Cloudflare, you need to adjust your configuration to avoid CSRF and host validation issues. Please follow the instructions here: [Trusted Proxies & Cloudflare](/advanced-topics/security-hardening/trusted-proxies.md).
{% endhint %}

{% hint style="info" %}
More about the PteroCA configuration process during installation can be found in [System Configuration](/core-configuration/core-configuration.md).
{% endhint %}

***

## Post-Installation Steps

After completing the installation, configure the following to ensure full functionality:

### 1. Install PteroCA Plugin for Pterodactyl

{% hint style="warning" %}
**Required for full integration**

The PteroCA Plugin must be installed in your Pterodactyl panel to enable features like:

* Server console access
* Real-time statistics
* Server variable management
* SSO authentication
  {% endhint %}

If you installed Pterodactyl using our autoinstaller, the plugin is already installed. Otherwise, follow the installation guide:

👉 [**Install PteroCA Plugin for Pterodactyl**](/core-configuration/pterodactyl-integration/addon-installation.md)

### 2. Configure Allowed Origins (Console Access)

For the server console to work properly, you need to configure `allowed_origins` in your Pterodactyl Wings configuration.

This allows PteroCA to communicate with Pterodactyl Wings for console access and real-time server management.

👉 [**Configure Allowed Origins**](/core-configuration/pterodactyl-integration/allowed-origins.md)

{% hint style="info" %}
You can configure allowed origins at any time - it doesn't need to be done immediately during installation.
{% endhint %}

### 3. Complete System Configuration

Configure your panel settings through the CLI wizard or Admin Panel:

* [**General Settings**](/core-configuration/core-configuration/general-settings.md) - Site title, logo, locale
* [**Email Settings**](/core-configuration/core-configuration/email-configuration.md) - SMTP configuration for notifications
* [**Payment Settings**](/core-configuration/core-configuration/payment-configuration.md) - Stripe integration for payments
* [**Pterodactyl Settings**](/core-configuration/core-configuration/pterodactyl-settings.md) - API connection and SSO setup

👉 [**View all configuration options**](/core-configuration/core-configuration.md)

***

## Getting Help

If you encounter issues during automatic installation:

1. **Check the documentation:**
   * Review [Installation Troubleshooting](/help-and-maintenance/troubleshooting/installation-issues.md)
   * See [Common installation errors](/help-and-maintenance/troubleshooting/installation-issues.md#auto-installer-issues)
2. **Gather information before asking for help:**
   * Installation log output (copy the full terminal output)
   * Your operating system: `cat /etc/os-release`
   * Selected options (PHP version, domain, configuration method)
3. **Get support:**
   * **Discord (fastest):** Join our [Discord community](https://discord.com/invite/Gz5phhuZym) and share your error
   * **GitHub:** Open an issue on [GitHub](https://github.com/PteroCA-Org/panel/issues) with installation logs

***

{% hint style="success" %}
**🎉 Installation Complete!**

Enjoying PteroCA? Help us grow by giving us a star on GitHub! ⭐

👉 [Star PteroCA on GitHub](https://github.com/PteroCA-Org/panel)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pteroca.com/installation/installation/automatic-installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
