Community GuidesTutorials

Artisan Commands

Manage users, nodes, servers, and the Panel itself from the command line.

Introduction

Artisan is the command-line interface of Laravel, the framework the Panel is built on. The Panel's own commands start with p:. Run them from the Panel's directory:

cd /var/www/pterodactyl
php artisan list p

To see a command's options, use help:

php artisan help p:user:make

Most commands prompt for any value you do not pass as an option. To run one without prompts, such as in a script, pass every option and add --no-interaction.

Users

Creating a User

php artisan p:user:make

The command asks for the email address, username, first and last name, password, and whether the user is an administrator. You can pass these as options instead:

php artisan p:user:make [email protected] --username=jane --name-first=Jane --name-last=Doe --admin=0

The command still asks for the password, to keep it out of your shell history. To create the user without a password, add --no-password. The Panel then emails the user a link to set one.

Deleting a User

php artisan p:user:delete [email protected]

--user matches the start of a user's ID, username, or email address. The command lists the matches and asks which one to delete. A user who still owns servers cannot be deleted.

Disabling Two-Factor Authentication

If a user loses their two-factor device and recovery codes, turn off two-factor authentication for them:

php artisan p:user:disable2fa [email protected]

Confirm the user's identity first. Afterward, anyone who knows the user's password can sign in.

Locations and Nodes

Creating and Deleting Locations

php artisan p:location:make --short=us1 --long="United States, East"
php artisan p:location:delete --short=us1

A location that still has nodes cannot be deleted.

Creating a Node

php artisan p:node:make

The command asks for the same details as the admin area's New node page, including the location ID, domain name, ports, and resource limits. Run php artisan help p:node:make for the matching options.

Listing Nodes

php artisan p:node:list

Add --format=json for JSON output.

Showing a Node's Configuration

Prints a node's Wings configuration, the same file its Configuration tab shows. Pass the node's ID or UUID:

php artisan p:node:configuration 1

If the Panel and Wings run on the same machine, you can save it straight to Wings' configuration file:

php artisan p:node:configuration 1 > /etc/pterodactyl/config.yml

Add --format=json to print it as JSON.

Servers

Power Actions for Many Servers

p:server:bulk-power sends start, stop, restart, or kill to many servers at once:

# Restart every server.
php artisan p:server:bulk-power restart

# Restart servers 1, 2, and 3.
php artisan p:server:bulk-power restart --servers=1,2,3

# Stop every server on nodes 1 and 2.
php artisan p:server:bulk-power stop --nodes=1,2

--servers and --nodes take IDs. Without either, the action applies to every server. The command first shows how many servers it will affect and asks you to confirm.

The Panel

Showing the Panel's Configuration

php artisan p:info

Shows the Panel's version, address, and database, cache, and email settings. Include this output when you ask for help, with any passwords removed.

Changing the Environment

These commands update your .env file. They are the same ones you ran during installation:

php artisan p:environment:setup
php artisan p:environment:database
php artisan p:environment:mail

Updating the Panel

php artisan p:upgrade --release=<version>

Downloads a new release and runs the update steps for you. Until 2.0 is released, use the manual steps instead. See Updating the Panel.

Viewing Telemetry Data

php artisan p:telemetry

Prints the anonymous usage data the Panel sends when telemetry is enabled, without sending it. See Telemetry.

Extensions and Themes

The p:extension commands install, enable, disable, and remove extensions. See Extensions.

The p:theme commands apply a theme to the Panel. See Themes.

Edit on GitHub

Last updated on

On this page