Configuration

The active directory should still be /usr/share/webapps/pixelfed

Initialize Pixelfed services:

sudo php artisan key:generate
sudo php artisan storage:link
sudo php artisan migrate --force
sudo php artisan import:cities
sudo php artisan instance:actor
sudo php artisan passport:keys
sudo php artisan horizon:install
sudo php artisan horizon:publish

Set up background service

Create the systemd service file:

sudo nano /etc/systemd/system/pixelfed.service

And paste:

[Unit]
Description=Pixelfed task queueing via Laravel Horizon
After=network.target mysql.service php8.4-fpm.service redis-server.service apache2.service
Requires=mysql.service php8.4-fpm.service redis-server.service apache2.service

[Service]
Type=simple
User=pixelfed-user
WorkingDirectory=/usr/share/webapps/pixelfed
ExecStart=/usr/bin/php8.4 artisan horizon
Restart=always
RestartSec=5
Environment=QUEUE_CONNECTION=redis

[Install]
WantedBy=multi-user.target

Save and exit Nano.
Reload systemctl daemon:

sudo systemctl daemon-reload

And start Pixelfed:

sudo systemctl enable --now pixelfed

Create a Cron job:

sudo crontab -u pixelfed-user -e

At the end of the file, paste this line:

* * * * * /usr/bin/php8.4 /usr/share/webapps/pixelfed/artisan schedule:run >> /dev/null 2>&1

Modify configuration files

For each file, edit the designated lines, then save and exit Nano:

sudo nano config/app.php
    'name' => env('APP_NAME', 'Pixelfed Demo'),
    'url' => env('APP_URL', 'https://pixelfed.fediverse.ovh'),
    'locale' => env('APP_LOCALE', 'en'),

 

sudo nano config/instance.php
    'description' => env('INSTANCE_DESCRIPTION', 'Pixelfed Demo website for pixelfed.howto.ovh tutorial'),

 

sudo nano config/pixelfed.php
    'domain' => [
        'admin' => env('ADMIN_DOMAIN'),
        'app' => env('APP_DOMAIN', 'pixelfed.fediverse.ovh'),
    ],

Create the first user

sudo php artisan user:create
Creating a new user...

Name:
> Yves LeGuellec

Username:
> leguellec

Email:
> leguellec@fediverse.ovh

Password:
> pixelfed-password

Confirm password:
> pixelfed-password

Make this user an admin? (yes/no) [no]:
> yes

Manually verify email address? (yes/no) [no]:
> no

Are you sure you want to create this user? (yes/no) [no]:
> yes

Verify the user:

sudo php artisan user:verify leguellec

Visit https://pixelfed.fediverse.ovh/i/actor to activate cache.
And visit the instance pixelfed.fediverse.ovh.