Your content here
✅ Etapas completas da nova instalação
🧱 1. Pré-requisitos (no LXC Debian 12)
apt update && apt upgrade -y
apt install -y sudo git curl unzip php php-cli php-common php-mbstring php-xml \
php-bcmath php-curl php-gd php-mysql php-pgsql php-redis php-zip php-intl php-imagick \
php-opcache php-readline php-tokenizer php-fileinfo php-fpm php-exif \
php8.3 php8.3-cli php8.3-common php8.3-mbstring php8.3-xml php8.3-mysql \
nginx mariadb-server redis unzip ffmpeg imagemagick composer supervisor ntp
👤 2. Crie o usuário pixelfed
bash
Copiar
Editar
adduser --disabled-password --gecos "" pixelfed
usermod -aG sudo pixelfed
💾 3. Banco de Dados
bash
Copiar
Editar
mysql -u root -p
sql
Copiar
Editar
CREATE DATABASE pixelfed CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'pixelfed'@'localhost' IDENTIFIED BY 'SENHA_FORTE';
GRANT ALL PRIVILEGES ON pixelfed.* TO 'pixelfed'@'localhost';
FLUSH PRIVILEGES;
EXIT;
📥 4. Instale o Pixelfed
bash
Copiar
Editar
sudo -u pixelfed -i
cd ~
git clone https://github.com/pixelfed/pixelfed.git
cd pixelfed
cp .env.example .env
composer install --no-dev --optimize-autoloader
php artisan key:generate
php artisan config:clear
php artisan cache:clear
⚙️ 5. Configure o .env (resumo das variáveis importantes)
env
Copiar
Editar
APP_NAME=Pixelfed
APP_ENV=production
APP_KEY=gerado_pelo_key:generate
APP_DEBUG=false
APP_URL=https://pixelfed.zanoni.top
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=pixelfed
DB_USERNAME=pixelfed
DB_PASSWORD=SENHA_FORTE
SESSION_DRIVER=file
SESSION_DOMAIN=.zanoni.top
ACTIVITY_PUB=true
PIXELFED_STORIES_ENABLED=true
PIXELFED_VIDEO=true
🧱 6. Migrar banco e gerar storage
bash
Copiar
Editar
php artisan migrate --force
php artisan storage:link
php artisan instance:actor
🛠️ 7. Configurar Systemd para web e worker
📄 /etc/systemd/system/pixelfed-web.service
ini
Copiar
Editar
[Unit]
Description=Pixelfed Web
After=network.target
[Service]
User=pixelfed
Group=pixelfed
Restart=always
WorkingDirectory=/home/pixelfed/pixelfed
ExecStart=/usr/bin/php artisan serve --host=0.0.0.0 --port=8080
[Install]
WantedBy=multi-user.target
📄 /etc/systemd/system/pixelfed-worker.service
ini
Copiar
Editar
[Unit]
Description=Pixelfed Worker
After=network.target
[Service]
User=pixelfed
Group=pixelfed
Restart=always
WorkingDirectory=/home/pixelfed/pixelfed
ExecStart=/usr/bin/php artisan queue:work --sleep=3 --tries=3 --timeout=90
[Install]
WantedBy=multi-user.target
Ative os serviços:
bash
Copiar
Editar
systemctl daemon-reload
systemctl enable pixelfed-web
systemctl enable pixelfed-worker
systemctl start pixelfed-web
systemctl start pixelfed-worker
🌍 8. Configure o Nginx Proxy Manager
Host: pixelfed.zanoni.top
Forward para IP do LXC, porta 8080
Habilite Websockets e Preserve Host
✅ Finalize com:
bash
Copiar
Editar
php artisan config:cache
php artisan route:cache
php artisan view:cache
Você terá uma instância com:
✅ Upload de vídeos
✅ Stories habilitados
✅ Federação via ActivityPub
✅ HTTPS via Proxy
✅ Start automático com systemd