Friendica

Friendica is a decentralized social networking platform that you can install on your own server. Here’s a step-by-step guide to installing Friendica on a Linux server.

---

## **Prerequisites**
1. **A VPS or dedicated server** (Ubuntu/Debian recommended)
2. **LAMP or LEMP stack** (Apache/Nginx, MySQL/MariaDB, PHP)
3. **Domain name** (Optional but recommended)
4. **SSL certificate** (Let's Encrypt or another provider)

---

## **Step 1: Update Your Server**
Before starting, update your system packages:
```bash
sudo apt update && sudo apt upgrade -y
```

---

## **Step 2: Install Required Packages**
### Install Apache, MariaDB, and PHP
```bash
sudo apt install apache2 mariadb-server php php-cli php-mysql php-gd php-curl php-xml php-mbstring unzip -y
```

### Enable Apache Modules
```bash
sudo a2enmod rewrite headers ssl
sudo systemctl restart apache2
```

---

## **Step 3: Set Up Database**
Log into MariaDB:
```bash
sudo mysql -u root -p
```
Create a new database and user:
```sql
CREATE DATABASE friendica;
CREATE USER 'friendica_user'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON friendica.* TO 'friendica_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
```

---

## **Step 4: Download and Configure Friendica**
### Download Friendica:
```bash
cd /var/www
git clone https://github.com/friendica/friendica.git friendica
cd friendica
git clone https://github.com/friendica/friendica-addons.git addon
```

### Set Correct Permissions:
```bash
sudo chown -R www-data:www-data /var/www/friendica
sudo chmod -R 755 /var/www/friendica
```

---

## **Step 5: Configure Apache**
Create a new virtual host file:
```bash
sudo nano /etc/apache2/sites-available/friendica.conf
```
Add the following configuration (replace **yourdomain.com** with your actual domain):
```
<VirtualHost *:80>
    ServerName yourdomain.com
    DocumentRoot /var/www/friendica

    <Directory /var/www/friendica>
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/friendica_error.log
    CustomLog ${APACHE_LOG_DIR}/friendica_access.log combined
</VirtualHost>
```

Enable the site and restart Apache:
```bash
sudo a2ensite friendica
sudo systemctl reload apache2
```

---

## **Step 6: Secure with Let's Encrypt (SSL)**
If you have a domain, install Let's Encrypt SSL:
```bash
sudo apt install certbot python3-certbot-apache -y
sudo certbot --apache -d yourdomain.com
```

---

## **Step 7: Run the Friendica Web Installer**
1. Open your browser and go to `http://yourdomain.com`
2. Follow the on-screen instructions:
   - Enter the database details
   - Configure site settings
   - Create an admin account

---

## **Step 8: Set Up a Cron Job**
For background tasks, add a cron job:
```bash
sudo crontab -e
```
Add the following line:
```
*/10 * * * * cd /var/www/friendica && php bin/worker.php
```
This ensures Friendica runs periodic maintenance tasks.

---

## **Step 9: Finalize Installation**
- Log in to your Friendica instance
- Customize settings
- Install addons (`Settings > Addons`)
- Invite friends and federate with other networks!

---

That’s it! 🎉 Your Friendica instance is now live. Let me know if you need help with anything! 🚀

Views: 33