How I set up my self-hosted services
I want to expand on my previous post a little bit to explain the steps I took to setup PeerTube, Ente, and WriteFreely.
Prerequisites
I set everything up on two different VPSs. PeerTube was on a new domain, so I used an Ionos VPS. Ente and WriteFreely are on my main VPS (powering this website) since they were on subdomains of this domain.
All intensive storage (photos and videos) happens on Backblaze B2. I love Backblaze for its reliably cheap storage and excellent APIs (including, crucially for this use-case, S3-compatible APIs).
PeerTube
I first followed the steps here to do the basic setup. I followed all of those instructions (including setting up the reverse proxy and systemd service. Because this is a fresh VPS, I did not have any port conflicts (this was not the case with the others as will be clear) and I could use the support reverse proxy (nginx).
Then, it was time to setup the object storage according to this page. I went to Backblaze B2, created a new bucket for PeerTube, and made it public. Then, I generated an application key (restricted only to that bucket), ensuring that the key had the ability to list all buckets (necessary for an S3-compatible key). Then, all I had to do was fill in all of the information in config/production.yaml according to the documentation, restart PeerTube (systemctl restart peertube), and I was good to go!
Initially, I had disabled transcoding, opting only to keep one resolution of the video (effectively just the original file). I later enabled HLS transcoding and manually ran the HLS transcoding jobs on the uploaded videos (possible through the admin interface). Everything went smoothly and the existing videos were (slowly) transcoded. I say slowly simply because the VPS only has 2 cores, so I can't really run transcoding jobs in parallel.
I initially had tried to setup a remote runner, but it was having trouble with transcoding large files, so I disabled it for now. I will probably retry the runner with the next upload and see how it goes.
Ente
I had initially tried self-hosting Ente a few months ago when I first heard about it after asking for a self-hosted gallery with object storage support over on Mastodon. However, while I was able to get it up and running, I was running into issues completing the registration and getting the object storage backend up and running, so I gave up.
Then, about a week ago, I decided to try again and actually got it working. I followed the self-hosting directions and got it installed, but I kept running into CORS issues when I attempted to register (the same issue I ran into earlier).
I then realized that I had to set the environment block in compose.yaml to the IP address (rather than localhost), and that was enough to get it working. I then similarly set up a bucket in B2 for Ente and set up the object storage backend. I then tried a few test uploads and it worked!
When I went to configure the reverse-proxy, I had to set it up with apache instead of nginx because apache was already being used for my main web server. There are numerous guides for doing it, so I won't elaborate here, but it's pretty straightforward.
What I also hadn't realized originally was that I needed to enable all of the components on subdomains. For example, the main Ente domain is https://photos.chiraag.me, and all of the sub-components needed to be hosted on subdomains of that (e.g. https://api.photos.chiraag.me and so on —– I just used the standard subdomain names given in the documentation). Once I had configured this, added all of the subdomain reverse proxy entries, and used cerbot --apache to generate the SSL certificates (or, more accurately, expand the existing one to cover the new subdomains), everything worked great. Everything is automatically encrypted client-side, then uploaded to my B2 bucket. Then I can create public albums and share them (like at https://chiraag.me/albums).
WriteFreely
There's honestly not a lot to write about here. It's a static binary that I just downloaded and configured with the wizard. Everything just worked (I used the SQLite backend rather than MySQL) and it has everything I want and nothing that I don't.
Conclusion
This is honestly just a plug for the different services I've setup. Our PeerTube is here. Albums shared through Ente can be found here. And, of course, you're already on the blog!