PixelFed is a free, open-source and federated alternative to Instagram that allows you to share photos and videos with your friends and family in a privacy-respected manner. In this tutorial, we will guide you through the process of installing PixelFed on MXLinux Latest.
Before we proceed, make sure you have the following prerequisites:
Before installing any new software, it's always recommended to ensure your system is up-to-date.
$ sudo apt-get update -y && sudo apt-get upgrade -y
PixelFed require some packages before being installed. In MXLinux Latest, run the following command to install the required dependencies:
$ sudo apt install apache2 mysql-server php7.3 php7.3-common php7.3-mysql php7.3-curl php7.3-json php7.3-mbstring php7.3-mysql php7.3-xml php7.3-gd php7.3-zip php7.3-fpm
The first step is to clone the current project files from Github. You can do this by running the following command:
$ sudo git clone https://github.com/pixelfed/pixelfed.git /var/www/html/pixelfed
Next, switch to the directory where you just cloned the project files using the following command:
$ cd /var/www/html/pixelfed
Install project dependencies by running the following command:
$ sudo composer install --no-dev
After installing the required dependencies, you need to copy the sample configuration file to the .env file:
$ sudo cp .env.example .env
Update the .env file with your database details:
APP_URL=https://pixelfed.example.com
APP_ENV=prod
APP_DEBUG=false
APP_KEY=base64:uDS7VU*******RWm1M=
APP_CIPHER=rijndael-128
APP_NAME="PixelFed"
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=pixelfed
DB_USERNAME=root
DB_PASSWORD=
SESSION_DRIVER=database
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=tls
Change the database name, username, and password to your values.
You also need to generate application key using:
$ sudo php artisan key:generate
You should now have a new application key (.env variable APP_KEY) which is used for encryptions and should not be shared with anyone.
Create a new MySQL database and user using the following commands:
$ sudo mysql -u root
mysql> CREATE DATABASE pixelfed;
mysql> CREATE USER 'pixelfeduser'@'localhost' IDENTIFIED BY 'yourpassword';
mysql> GRANT ALL PRIVILEGES ON pixelfed.* TO 'pixelfeduser'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> \q
Update your database with the new schema and tables with the following command:
$ sudo php artisan migrate
Then, create the storage symbolic link with the following command:
$ sudo php artisan storage:link
Restart the Apache service using the following command:
$ sudo systemctl restart apache2
Now you need to configure Apache to serve PixelFed.
Create a new virtual host configuration file:
$ sudo nano /etc/apache2/sites-available/pixelfed.conf
Paste the following configuration:
<VirtualHost *:80>
ServerName pixelfed.example.com
DocumentRoot /var/www/html/pixelfed/public
<Directory /var/www/html/pixelfed/public>
Options Indexes FollowSymLinks Includes ExecCGI MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Replace "pixelfed.example.com" with your own domain name.
Then, enable the new virtual host:
$ sudo a2ensite pixelfed.conf
Disable the default virtual host:
$ sudo a2dissite 000-default.conf
Restart the Apache service for the changes to take effect:
$ sudo systemctl restart apache2
Now, launch your favorite web browser and go to your PixelFed installation at "http://pixelfed.example.com". From there, you can create a new account and start using the platform.
Congratulations! You have successfully installed PixelFed on your MXLinux Latest server. You can now start sharing your photos and videos with your friends and family.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!