Introduction
After some requests, I'm doing today a guide to show you how I self host my own Piped Instance. It's pretty easy and you can get started with a really low investment.
If you are clueless about what is a piped instance, you can take a look on this other guide showing why it can be useful for you.
Requirements
- A domain
- A VPS that supports docker (search for a KVM provider, most openVZ VPS's are on a older kernel that won't work with docker)
- 20 minutes or less from your time
- A linux distro that you are comfortable with (I'll be using Ubuntu 20.04)
The provider that I'm using right now is RackNerd. Their service is quite good and they have an amazing price compared with classic options like Linode, Digital Ocean, Vultr, etc. If you want to help me, you can use my affiliate link HERE and buy a VPS with a really good price.
Getting started
As always, make sure to secure your VPS. Once that is done, you can start installing the required packages. If you are not sure how to do it, just choose Ubuntu 20.04 and copy and paste the following command inside the root user:
apt update
apt upgrade
apt install git apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
If you get this update warning in the middle, just hit enter:
Doing the Docker setup
Docker is the easiest thing in the world to setup. The way that I like to setup it is putting the folder that contains the docker file inside /opt. If you want to follow my seutp, you can do the following:
mkdir /opt
cd /opt/
git clone https://github.com/TeamPiped/Piped-Docker
cd Piped-Docker
./configure-instance.sh
Now, after you used the configure-instance.sh script, you need to choose the subdomains and the domain that you want for your instance. I'do recommend using "piped.yourdomain.com" for the frontend.
For the Backend, you can use something like "pipedapi.yourdomain.com". And finally for the proxy, you can choose "pipedproxy.yourdomain.com". Of course, you can choose other domains, just make sure that you remember the domains so you can point them at your DNS server too. For the proxy, I highly recommend caddy as it is easier to setup and the performance is not much bad compared with nginx (it may even perform better under medium load):
DNS
For the DNS part, you need to point the domain and the subdomains that you craeted. Here is a example:
You basically just need to create three A records for each part of your piped pointing to your VPS IP.
Turning on your containers
To finally turn your docker container ON, you can use the following command:
docker compose up -d
After that, your piped should be up and running at piped.yourdomain.com if you used this name. If for some reason it isn't working yet, it's possible that DNS is still proapgating, so the SSL couldn't be issued. The issue should solve itself after a few minutes or a few hours depending on the DNS propagation speed.
Checking logs
If you ever need to check the logs, you can use the following command:
docker logs -f --tail 1 nginx
It will show you the requests that are being made to your server.
Conclusion
Hosting your own Piped instance is pretty easy! You can get started today and use it for yourself or for your community. Feel free to use my instance as well as described on this guide
If you enjoyed this article, you can share it your friends or subscribe to The Self Hosting Art to keep us motivated. Thank you for reading :)You can also help with Monero, Litecoin, Bitcoin or Nano: Monero:837X2SppmrrPkBbpsy9HQU1RFxKhsBcn6GdQv2wR5wGoiw8ctfh6Rt36xaszveZHysYA5KSDBr51y5YuQ3YCV23sJS9nhqW BTC:bc1qrvgz7dzzlfllulakw87vzvtf7s2u8t0sxpjehr Litecoin:ltc1qycz6ssg6xjxttuld6l6ulzqdr3y70rm8wv2g9p Nano:nano_1jmd6dg4dbem7f3wrojr7g45ioe6eb5et3iq11f8urfxe8qausxipup8bhua