Oct 9, 2024 3 min read

Projectsend: Simplifying Self-Hosting

Projectsend: Simplifying Self-Hosting
Table of Contents

Projectsend is a self-hosted file sharing application designed to streamline the secure delivery and management of files to clients or team members. With its robust customization options, full data control, and ease of deployment, Projectsend is an excellent choice for organizations seeking a private file management solution. In this guide, we’ll cover the complete process of deploying, configuring, securing, and managing Projectsend to help you maximize its potential.

Installing Projectsend

πŸ“¦ Docker/Docker Compose Setup

Using Docker is one of the easiest ways to deploy Projectsend. Below is a docker-compose.yml file tailored for Projectsend:


version: '3.8'

services:

projectsend:

image: projectsend/projectsend:latest

container_name: projectsend

ports:

- "8080:80"

volumes:

- ./data:/var/www/html/upload

- ./config:/var/www/html/config

environment:

- APACHE_RUN_USER=www-data

- APACHE_RUN_GROUP=www-data

restart: always

Save the file, and then use the following commands to deploy Projectsend:


docker-compose up -d

## Check container logs to ensure it's running properly

docker logs projectsend

This will map Projectsend to port 8080 on your server, with file uploads and configuration stored in the ./data and ./config directories.

πŸš€ Manual Installation

For a manual installation on a Linux server (e.g., Ubuntu), follow these steps:


## Update the system

sudo apt update && sudo apt upgrade -y

## Install necessary dependencies

sudo apt install apache2 php php-mysql mariadb-server unzip -y

## Download Projectsend

wget https://www.projectsend.org/download -O projectsend.zip

## Extract and move the files

unzip projectsend.zip

sudo mv projectsend /var/www/html/projectsend

## Set proper permissions

sudo chown -R www-data:www-data /var/www/html/projectsend

sudo chmod -R 755 /var/www/html/projectsend

## Enable Apache modules and restart the service

sudo a2enmod rewrite

sudo systemctl restart apache2

Visit http://your-server-ip/projectsend to complete the installation via the web interface.

Configuring Nginx as a Reverse Proxy

🌐 Nginx Configuration

To serve Projectsend behind Nginx, create a new server block configuration file:


sudo nano /etc/nginx/sites-available/projectsend

Add the following content:


server {

listen 80;

server_name yourdomain.com;

location / {

proxy_pass http://127.0.0.1:8080; # Adjust if using Docker or Apache

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

client_max_body_size 100M; # Adjust file upload size as needed

}

Enable the configuration and restart Nginx:


sudo ln -s /etc/nginx/sites-available/projectsend /etc/nginx/sites-enabled/

sudo nginx -t

sudo systemctl restart nginx

πŸ”’ SSL/TLS Setup

Secure your server with a free Let's Encrypt certificate:


sudo apt install certbot python3-certbot-nginx -y

sudo certbot --nginx -d yourdomain.com

Certbot automatically updates your Nginx configuration and sets up renewals.

πŸ› οΈ Testing and Reloading Nginx

After changes, test and reload Nginx:


sudo nginx -t

sudo systemctl reload nginx

Verify access to your Projectsend instance via https://yourdomain.com.

Logging and Debugging Projectsend

πŸ—ƒοΈ Enabling Debug Logs

Enable debug logging in Projectsend by editing its configuration file:


sudo nano /var/www/html/projectsend/includes/config.php

Add or modify the following line:


define('DEBUG_MODE', true);

Save and reload your application.

πŸ“„ Viewing Logs

For Docker users, view logs using:


docker logs projectsend

For manual installations, check the Apache logs:


sudo tail -f /var/log/apache2/error.log

πŸ› οΈ Troubleshooting Common Issues

  • Database connection errors: Recheck your database credentials in config.php.

  • File upload errors: Verify client_max_body_size in your Nginx or PHP configurations.

πŸ“€ Exporting Logs

To send logs to an ELK stack, configure Filebeat or a similar tool to monitor Projectsend logs.

Backup and Restore

πŸ—‚οΈ File-Based Backups

Backup uploaded files and configurations:


tar -czvf projectsend_backup_$(date +%F).tar.gz /var/www/html/projectsend

πŸ”„ Database Backups

Export the database:


mysqldump -u root -p projectsend > projectsend_db_backup.sql

Restore with:


mysql -u root -p projectsend < projectsend_db_backup.sql

πŸ“… Automated Backup Scripts

Automate backups with a cron job:


crontab -e

Add the following line:


0 2 * * * tar -czvf /backups/projectsend_$(date +\%F).tar.gz /var/www/html/projectsend

Updating and Upgrading Projectsend

⬆️ Updating Docker Images

Pull the latest image and redeploy:


docker-compose pull

docker-compose up -d

πŸ› οΈ Manual Updates

For manual installations, download the latest version and replace core files:


wget https://www.projectsend.org/download -O projectsend_latest.zip

unzip projectsend_latest.zip

sudo cp -r projectsend/* /var/www/html/projectsend

sudo systemctl restart apache2

πŸ” Checking for Updates

Check the official Projectsend repository for updates and follow the instructions provided.

Leveraging Projectsend’s Unique Features

πŸ”§ Enabling APIs

Activate API support by editing your configuration file:


define('API_ENABLED', true);

Test the API using curl:


curl -X GET https://yourdomain.com/api/ -H "Authorization: Bearer YOUR_API_KEY"

🌟 Advanced Configurations

Modify settings to enable advanced features, like custom branding or user roles, via the admin dashboard under β€œSystem Options.”

Wrapping Up

By following this guide, you’ve successfully installed, configured, and secured your Projectsend instance. With its flexibility and full control over your data, Projectsend empowers you to manage file sharing on your own terms. Start exploring its features, and integrate it into your workflows to optimize your file delivery processes.

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to Selfhosted Ninja.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.