Previous Page

nihilist - 00 / 00 / 00

CGI Lainsafe Setup

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

First install the dependencies:

apt update -y
apt install socat libcgi-pm-perl nginx curl fcgiwrap -y


wget -O - | sh
source ~/.bashrc

get a domain name, you can use

verify it is pointing to your server's ip:

Then get your free letsencrypt certificate using

systemctl stop nginx --issue --standalone -d -k 4096
systemctl start nginx 

once that's done, configure nginx:

wget -O /etc/nginx/conf.d/lainsafe.conf
nano /etc/nginx/conf.d/lainsafe.conf

In nano, make sure you edit the configuration to match your domain name:

At the bottom you can change the maximum file upload size, by default it is 100mb. Once you're done, hit CTRL+S to save and CTRL+X to exit nano.

next we reload nginx and install lainsafe files:

nginx -s reload
mkdir /var/www/lainsafe/

cd /var/www/lainsafe/
mkdir .cgi
mkdir files


chmod +x index.cgi
chmod +x upload.cgi

chown -R www-data: /var/www/lainsafe/

And from here just browse to your website:

Then just upload a file, and it will give you the link to it:

And that's it! just do ALT+leftarrow to return to the homepage. Obviously this was meant to be very minimalistic by the author so i'll leave it to you as to how you customise the page with css and more.

Uploading Files with Lainsafecli

From Arch Linux: (AUR)

[ ] [ /dev/pts/2 ] [~]
→ yay -S lainsafecli

From Debian:

echo "deb stable main" >> /etc/apt/sources.list
wget -q -O - | sudo apt-key add
sudo apt updates
sudo apt install lainsafecli


[ ] [ /dev/pts/2 ] [~]
→ lainsafecli --help
lainsafecli, a command line interface for lainsafe.
USAGE: lainsafecli [--tor | --i2p] [--server] FILE

if --server not given, is used.
--tor and --i2p are unavailable, flag are ignored

You can use lainsafecli with your own server like so:


Until there is Nothing left.

About nihilist

Donate XMR: 8AUYjhQeG3D5aodJDtqG499N5jXXM71gYKD8LgSsFB9BUV1o7muLv3DXHoydRTK4SZaaUBq4EAUqpZHLrX2VZLH71Jrd9k8

Contact: (PGP)