Install Pixelfed with docker

Pixelfed_logo

  1. Create a working directory and in it execute:
    git clone https://github.com/pixelfed/pixelfed
    
  2. View the current tags with:
    cd pixelfed    git tag
     v0.1.9
     v0.10.0
     v0.10.1
     v0.10.10
     v0.10.2
     v0.10.3
     v0.10.4
     v0.10.5
     v0.10.6
     v0.10.7
     v0.10.8
     v0.10.9
     v0.11.0
     v0.11.1
     v0.5.9
     v0.6.0
     v0.6.1
     v0.7.6
     v0.8.0
     v0.8.5
     v0.8.6
     v0.9.0
     v0.9.4
     v0.9.5
     v0.9.6
    
  3. Download latest version, which currently in my case is v.0.11.1 by running:
git checkout tags/v0.11.1
  1. You can confirm the version you are using with this command:
$ git branch
* (HEAD detached at v0.10.10)
  dev
  1. Edit your .env.docker file, change your domain name and if you are using the website just for yourself you probably will want to disable open registration also. So change:
APPURL=https://pixel.criadoperez.com
APPDOMAIN=“pixel.criadoperez.com”
ADMINDOMAIN=“pixel.criadoperez.com”
SESSIONDOMAIN=“pixel.criadoperez.com”
OPEN_REGISTRATION=false
      - MYSQL_DATABASE=pixelfed
      - MYSQL_USER=pixelfed
      - MYSQL_PASSWORD=pixelfed
      - MYSQL_RANDOM_ROOT_PASSWORD=true
  1. The docker-compose.yml file is configured to use port 8080. If that’s ok for you you can leave it as it is. In my case as I have several other containers, this port is already in use so I need to change it to 8085. To do this change line 31 of file docker-compose.yml from “8080:80” to “8085:80”.

  2. Start your docker-compose file:

docker-compose up -d
  1. Set up your key:
    $ docker-compose exec app php artisan key:generate
    Application key set successfully.
    
  2. You can verify it worked by seeing if you have a value (I put asterisks instead of my real key):
    $ cat .env.docker | grep APP_KEY
    APP_KEY=base64:**************************************
    
  3. Run the following docker-compose commands to get things properly configured:
    $ docker-compose exec app php artisan horizon
    Horizon started successfully.
    
$ docker-compose exec app php artisan package:discover
  Discovered Package: beyondcode/laravel-self-diagnosis
  Discovered Package: buzz/laravel-h-captcha
  Discovered Package: facade/ignition
  Discovered Package: fideloper/proxy
  Discovered Package: fruitcake/laravel-cors
  Discovered Package: intervention/image
  Discovered Package: jenssegers/agent
  Discovered Package: laravel/horizon
  Discovered Package: laravel/passport
  Discovered Package: laravel/tinker
  Discovered Package: laravel/ui
  Discovered Package: nesbot/carbon
  Discovered Package: nunomaduro/collision
  Discovered Package: pbmedia/laravel-ffmpeg
  Discovered Package: pixelfed/laravel-snowflake
  Discovered Package: spatie/laravel-backup
  Discovered Package: spatie/laravel-image-optimizer
  Discovered Package: stevebauman/purify
  Package manifest generated successfully.
$ docker-compose exec app php artisan horizon:install
  Publishing Horizon Service Provider...
  Publishing Horizon Assets...
  Publishing Horizon Configuration...
  Horizon scaffolding installed successfully.
$ docker-compose exec app php artisan route:cache
  Route cache cleared!
  Routes cached successfully!
  1. Restart your app:
$ docker-compose restart app
   Restarting pixelfed_app_1 ... done
  1. Enjoy!!