Skip to content

Powered by Grav

Reset Pixelfed

Erase the server and restart a fresh instance.

Stop cron jobs

Edit Cron jobs for the Pixelfed user

BASH
sudo crontab -u pixelfed -e

Comment the lines concerning Pixelfed

TXT
# * * * * * /usr/bin/php8.5 /usr/share/webapps/pixelfed/artisan schedule:run >> /dev/null 2>&1
# */5 * * * * /usr/bin/php8.5 /usr/share/webapps/pixelfed/artisan  horizon:snapshot >> /dev/null 2>&1

Stop Pixelfed

BASH
sudo systemctl stop pixelfed
sudo systemctl disable pixelfed

Backup current files

BASH
sudo rsync -av /usr/share/webapps/pixelfed/ /usr/share/webapps/pixelfed-old/

Delete current version directory content

BASH
sudo rm -r /usr/share/webapps/pixelfed

Delete and re-create database

BASH
sudo mariadb
SQL
DROP DATABASE pixelfeddb;
FLUSH PRIVILEGES;
CREATE DATABASE pixelfeddb;
GRANT ALL PRIVILEGES ON pixelfeddb.* TO 'pixelfed'@'localhost';
FLUSH PRIVILEGES;
quit

Reinstall Pixelfed

BASH
cd /usr/share/webapps/
sudo git clone -b dev https://github.com/pixelfed/pixelfed.git pixelfed
cd pixelfed
sudo find . -type d -exec chmod 755 {} \;
sudo find . -type f -exec chmod 644 {} \;
sudo composer install --no-ansi --no-interaction --optimize-autoloader

Restore previous setup

BASH
sudo cp /usr/share/webapps/pixelfed-old/.env /usr/share/webapps/pixelfed/
sudo chown -R pixelfed:pixelfed .
sudo -u pixelfed php /usr/share/webapps/pixelfed/artisan config:cache
sudo -u pixelfed php artisan key:generate
sudo -u pixelfed php artisan storage:link
sudo -u pixelfed php artisan migrate --force
sudo -u pixelfed php artisan import:cities
sudo -u pixelfed php artisan instance:actor
sudo -u pixelfed php artisan passport:keys
sudo -u pixelfed php artisan horizon:install
sudo -u pixelfed php artisan horizon:publish
sudo chown pixelfed:pixelfed /usr/share/webapps/pixelfed/storage/*.key
sudo chmod 600 /usr/share/webapps/pixelfed/storage/*.key
sudo systemctl daemon-reload
sudo systemctl enable --now pixelfed
sudo -u pixelfed cp /usr/share/webapps/pixelfed-old/config/app.php /usr/share/webapps/pixelfed/config/
sudo -u pixelfed cp /usr/share/webapps/pixelfed-old/config/instance.php /usr/share/webapps/pixelfed/config/
sudo -u pixelfed cp /usr/share/webapps/pixelfed-old/config/pixelfed.php /usr/share/webapps/pixelfed/config/

Reactivate cron jobs

BASH
sudo crontab -u pixelfed -e

Uncomment the previously commented lines

TXT
* * * * * /usr/bin/php8.5 /usr/share/webapps/pixelfed/artisan schedule:run >> /dev/null 2>&1
*/5 * * * * /usr/bin/php8.5 /usr/share/webapps/pixelfed/artisan  horizon:snapshot >> /dev/null 2>&1

Reboot and start over

BASH
sudo reboot

And follow again the initialization guide to create the first user.

© 2026 howto.cogip.be. All rights reserved.