Ech0 - 00 / 00 / 00

PHP LainSafe

Before we start, you will need a Debian 10+ VPS (you can get one on digitalocean for example), if you prefer to use your own self hosted server, make sure that port 80 and 443 are correctly port forwarded so that the public ip points to the server and not the router. Once that's done, go and ssh into your debian 10 server.

Initial Setup


apt update -y && apt upgrade -y
apt install nginx php7.3-fpm curl php7.3-common socat -y
systemctl enable --now nginx php7.3-fpm

Next get yourself a domain name, you can use DuckDNS

Nginx Configuration



Next configure nginx:


mkdir /var/www/html/filesafe
mkdir /var/www/html/filesafe/uploads/

wget https://ech1.github.io/blog/servers/phpfilesafe/phpfilesafe.conf -O /etc/nginx/conf.d/phpfilesafe.conf

wget https://ech1.github.io/blog/servers/phpfilesafe/logo.png -O /var/www/html/filesafe/logo.png
wget https://ech1.github.io/blog/wallpaper.png -O /var/www/html/filesafe/wallpaper.png
wget https://ech1.github.io/blog/servers/phpfilesafe/html/index.php -O /var/www/html/filesafe/index.php
wget https://ech1.github.io/blog/servers/phpfilesafe/html/style.css -O /var/www/html/filesafe/style.css
wget https://ech1.github.io/blog/servers/phpfilesafe/html/upload.php -O /var/www/html/filesafe/upload.php

cd /var/www/html/filesafe
chown -R www-data: .

Then get your free letsencrypt certificate using acme.sh:


wget -O -  https://get.acme.sh | sh
source ~/.bashrc


systemctl stop nginx 
acme.sh --issue --standalone -d ech2.duckdns.org -k 4096
systemctl start nginx 

nano /etc/nginx/conf.d/phpfilesafe.conf

Edit the nginx config to have your own domain name:

Once you're done, hit CTRL+S to save and CTRL+X to exit nano and just reload nginx, and view the website:

End Result



Reload the nginx configuration since we modified it:


nginx -t
nginx -s reload

Then just browse to your website:

And you're done! just upload your files (png, jpg, jpeg, pdf) (you can edit the extensions you want in upload.php)

If you want you can also edit the maximum filesize in the upload.php file (line 36)

My Bunker

Some Address 67120,
Duttlenheim, France.

About Ech0

This cute theme was created to showcase your work in a simple way. Use it wisely.