code-compareLinking your Repository

Open Startup Tab


  1. Open your server on the panel


  1. Navigate to the Startup Tab


Fill in content

You’re now on the Startup Tab, time to fill in content.


Prerequisites

Before starting the configuration, ensure the following requirements are met:

  • Your code is hosted in a repository on GitHub.

  • You have identified the primary branch you wish to deploy (e.g., main or master).

  • If your repository is private, you have generated a Personal Access Token (PAT) with repository access permissions.


Configuration Variables

Navigate to the Startup tab of your server on the Pterodactyl panel. Locate the Variables section and use the following table as a reference for filling out the fields:

Variable

Recommended Value

Description

GIT REPO ADDRESS

https://github.com/user/repo

The full HTTPS URL of your repository.

INSTALL BRANCH

main

The branch the server should track.

USER UPLOADED FILES

0

Set to 0 to prioritize Git over manual uploads.

AUTO UPDATE

1

Set to 1 to pull changes every time the server starts.

GIT USERNAME

YourUsername

Your GitHub account name.

GIT ACCESS TOKEN

ghp_yourtokenhere

Your Personal Access Token (required for private repos).

MAIN FILE

index.js

The script that starts your application.


Deployment Process

Once your variables are saved, you must trigger the initial link between the panel and GitHub.

1. Security Check

Ensure you have backed up any local files, such as .env files or SQLite databases, located in your server's File Manager. The initial connection process may clear existing data to ensure a clean clone of your repository.

2. Execution

To pull the code for the first time:

  1. Navigate to the Settings tab.

  2. Click the Reinstall Server button.

  3. Monitor the Console tab. You will see the system run git clone followed by your package manager's install command (e.g., npm install).


Workflow and Maintenance

After the initial setup, you can manage your server entirely through GitHub.

Action

Result

Push code to GitHub

Updates the repository but does not change the live server yet.

Restart Server

The panel detects the new commit and pulls it before starting the app.

Change Branch Variable

The server will switch to the new branch on the next restart.


Troubleshooting

Authentication Issues

If the console shows a "403 Forbidden" or "Authentication Failed" error, your token is likely invalid. Ensure that when you created the token on GitHub, you selected the repo scope.

Directory Conflicts

If the installation fails because the "destination path already exists," use the File Manager to delete all existing files in the root directory. Git requires an empty folder (or a folder it already manages) to perform a clone.

Main File Errors

If the server starts but immediately stops with a "Module not found" error, ensure your MAIN FILE variable matches the filename in your repository exactly (e.g., bot.js vs index.js).

Last updated

Was this helpful?