Create a new directory
BASH
sudo mkdir -p /usr/share/webapps
cd /usr/share/webapps/
Clone the Git repository of Pixelfed
BASH
sudo git clone -b dev https://github.com/pixelfed/pixelfed.git pixelfed
Set permissions
BASH
cd pixelfed
sudo find . -type d -exec chmod 755 {} \;
sudo find . -type f -exec chmod 644 {} \;
Environment
Initialize PHP dependencies with Composer
BASH
sudo composer install --no-ansi --no-interaction --optimize-autoloader
Generate environment variables and edit it
BASH
sudo cp .env.example .env
sudo nano .env
Change those paragraphs:
INI
APP_NAME="PIXELFED.COGIP.BE"
APP_ENV="production"
APP_KEY=
APP_DEBUG="false"
INI
# Instance URL Configuration
APP_URL="https://pixelfed.cogip.be"
APP_DOMAIN="pixelfed.cogip.be"
ADMIN_DOMAIN="pixelfed.cogip.be"
SESSION_DOMAIN="pixelfed.cogip.be"
TRUST_PROXIES="*"
INI
# Database Configuration
DB_CONNECTION="mysql"
DB_HOST="127.0.0.1"
DB_PORT="3306"
DB_DATABASE="pixelfeddb"
DB_USERNAME="pixelfed"
DB_PASSWORD="maria_db_password"
INI
# Redis Configuration
REDIS_CLIENT="phpredis" # https://github.com/pixelfed/pixelfed/issues/3633
REDIS_SCHEME="unix"
REDIS_PATH="/var/run/redis/redis-server.sock"
REDIS_HOST="/var/run/redis/redis-server.sock"
REDIS_PASSWORD="null"
REDIS_PORT="null"
INI
# Laravel Configuration
SESSION_DRIVER="database"
CACHE_STORE="redis"
QUEUE_DRIVER="redis"
BROADCAST_DRIVER="log"
LOG_CHANNEL="daily" # v0.12.10 trick
HORIZON_PREFIX="horizon-"
INI
# ActivityPub Configuration
ACTIVITY_PUB="true"
AP_REMOTE_FOLLOW="true"
AP_INBOX="true"
AP_OUTBOX="true"
AP_SHAREDINBOX="false"
The following variables are dedicated to send invites and password recovery emails. Create and verify a Mailtrap account. Setup the domain and the DNS zones entries in your domain name registrar. Mailtrap will then display an private API token for SMTP integration.
INI
## Mail Configuration (Post-Installer)
MAIL_DRIVER=smtp
MAIL_HOST=live.smtp.mailtrap.io
MAIL_PORT=587
MAIL_USERNAME=api
MAIL_PASSWORD=private_mailtrap_api_key
MAIL_ENCRYPTION=true
MAIL_FROM_ADDRESS="webmaster@cogip.be"
MAIL_FROM_NAME="PIXELFED.COGIP.BE Webmaster"
MAIL_AUTO_TLS=true # STARTTLS (false to bypass)
Change files ownership
BASH
sudo chown -R pixelfed:pixelfed .
Each future change of the .env file must be followed by this command
BASH
sudo -u pixelfed php /usr/share/webapps/pixelfed/artisan config:cache