Pixelfed! An ethical alternative to Instagram. Ethical because this decentralized network is run by enthusiastic users as moderators instead of the "Grow at all costs" corporation, which will be compelled to use your data against your own goodwill if that churns enough profits for them.
The best thing about Pixelfed is that, it's open source, and it's self-hostable. If you have some spare space on your servers, you could spin up a Pixelfed server and interact with the rest of the Fediverse. Isn't that cool? I recently spun up a Pixelfed instance on my server, and this is an explanatory post about the steps required to host an instance for yourself on your server. Let's dive in, shall we?
Before we could dive in...
Note: The instructions mentioned in this post concerns with Pixelfed version 0.11.3 with additional commits upto 352500f . I can't guarentee the instructions will ever work for the uncoming releases. Feel free to get in touch with me at Mastodon or Email if necessary.
Assuming that you have installed docker and docker-compose on your server, the next thing to note is to set up an .env file for docker-compose of Pixelfed. My .env file for my self-hosted instance is as follows
- Create a file
.env.pixelfedin your server directory.
- Copy the contents from the above to the
Make sure to replace the values mentioned under change this with the respective values that the database and mail server complies with. Once this .env file is all set and done, we move on to docker-compose setup.
The following is my docker-compose.yml file. I'm using the zknt/pixelfed image from the Dockerhub, since it's the most downloaded and actively maintained image of Pixelfed, yet.
Copy the following contents to a
docker-compose.yml file and keep it in the same directory as the
.env.pixelfed file. Change the contents as it pleases you. This is all you need to set up a Pixelfed instance on your server.
Note: Since I'm using traefik to manage my docker images, I tend to have a
webnetwork that binds with the traefik docker image. You could use other reverse proxies by removing the
appservice and by adding
ports: - 80:8080. In this you are redirecting the traffic coming to port 8080 to the docker port 80. More info here
In order to run Pixelfed, we need to create external docker volumes first. You could also use bind mounts to local directory. But I tend to use volumes so that I don't have to fiddle around with permission issues. The following commands will create four volumes.
Now for the climax, you need to run
docker-compose up -d (?)
Well, not so fast. You need to do so in steps so that the MariaDB and the Redis is set up properly.
- First, you need to run
docker-compose up -d mariadb redis. This will set up the MariaDB and Redis instance. You could also do
docker-compose logs -fto check the logs and see what's cooking in there.
- Once that's done, you should run
docker-compose up -d app. This will spin up the app instance and run all the database migrations that are required.
- Next, You need to run
docker-compose up -d worker. This will spin up the
workerinstance which will be responsible for Remote fetching account avatars and other ActivityPub stuff.
Once this is done, you could check the logs using
docker-compose logs -f to see if there are any errors in the installation. If not, we move on to the next step.
Firstly, you need to create an app key. Run
docker-compose exec app php artisan key:generate to generate an app key. This key will be added to your
.env.pixelfed file in
Now that the instance is set up properly, we need to create an admin user. You could do so by running
docker-compose exec app php artisan user:create. Then answer the prompts given on the screen, and you are done.
- Empty user profiles: For a brief moment, I had an issue of getting an empty user profile when remote account is being fetched. It was fixed by running
docker-compose exec app php artisan passport:installon my server as mentioned in this issue.
I'm very optimistic about a future where decentralized social media like, Pixelfed, Mastodon and the entirety of Fediverse is a thing. I hope to see this pick up steam among the netizens, and also hope to see the service itself becomes accessible to anyone and everyone. For that to happen, this is my small contribution to anyone who wants to spin up a server for themselves. Feel free to contact me for any assistance.
Have a nice day :)