Setting up PostgreSQL
Create a PostgreSQL database and user for the Skyport panel.
Skyport can talk to several databases through Laravel, but PostgreSQL is the recommended production choice.
1. Install PostgreSQL
Section titled “1. Install PostgreSQL”On Debian or Ubuntu:
sudo apt updatesudo apt install -y postgresql postgresql-contrib2. Create a database and user
Section titled “2. Create a database and user”Switch to the PostgreSQL superuser:
sudo -u postgres psqlThen run:
CREATE DATABASE skyport;CREATE USER skyport WITH ENCRYPTED PASSWORD 'change-me';GRANT ALL PRIVILEGES ON DATABASE skyport TO skyport;Then exit with:
\q3. Configure the panel .env
Section titled “3. Configure the panel .env”DB_CONNECTION=pgsqlDB_HOST=127.0.0.1DB_PORT=5432DB_DATABASE=skyportDB_USERNAME=skyportDB_PASSWORD=change-me4. Run migrations
Section titled “4. Run migrations”php artisan migrate --force5. Test the connection
Section titled “5. Test the connection”php artisan tinkerDB::connection()->getPdo();If that succeeds without an exception, the panel can reach PostgreSQL correctly.
Recommendation
Section titled “Recommendation”For production, keep PostgreSQL on a private interface or private network, not exposed to the public internet.