I plan to have the following services running concurrently on it:
- A VPN (OpenVPN or Wireguard)
- A very lightweight personal website
- A Nextcloud instance (25GB storage max)
- A Vaultwarden instance
- An Invidious instance
- A Matrix server
- A Lemmy instance
I’m unsure if these would be private or public instances. But I’d be curious to hear any thoughts on how much more space I’d need for public instances too, if you’d have a sense of that.
I currently have a VPS with 2GB RAM + 50GB storage. Would that be enough? Thanks in advance!
Of those Matrix Synapse would be the heaviest. Consider using Dendrite before you get locked into the bad Matrix software.
You could also check out Conduit, it’s still in beta but very lightweight.
Conduit is a lightweight open-source server implementation of the Matrix Specification with a focus on easy setup and low system requirements. That means you can make your own Conduit setup in just a few minutes.
So true, every few months I get the urge to ditch Synapse, but then I think about how much of a hassle it would be to migrate and happily pay a few bucks more for the extra RAM on the VPS. Don’t be me, use Dendrite right from the start.
Does your hosting provider support scaling that up?
This is all relatively lightweight stuff and I would guess that it could run all at the same time with the exception of matrix which is somewhat heavy.
I would also advise you to not run all of that on the same machine especially if you run some more critical stuff like nextcloud and especially vaultwarden on there. You want that to work and you want that to run reliably and safely. You don’t really want a bug in the lemmy instance to take down your private cloud or worse someone gaining access to your vaultwarden databse.
Thanks a lot – my provider does offer scaling up support. I’m also looking into swap partitions to artificially expand RAM.
Re-having it all on one instance, do you think Docker/Podman could help containerize everything and prevent one service from taking all others down?
Containerizing generally a very good idea. MIt provides security benefits in certain cases, keeps stuff organized and can prevent an application taking down other services. So yes. Definitely go for it. So I don’t have super in depth knowledge about docker. Idk if and how you can allocate and provision resources to specific containers. If for example your lemmy is just overloaded and by usage or just a bug it could issues with your other services even when running in a container.
I personally use Linux Containers (LXD/LXC) for pretty much everything. I can use them pretty much exactly like a VM even though they are just containers using the host resources but I can provision them properly. You can SSH into them just like into a normal Linux machine.
Speaking of linux containers there is something that you should check regardless of what container solution you want to use. With cheap VPS it is very common that you actually don’t pay for a real VM but what you have is actually a LXC (Linux Container). This is usually fine but it can cause issues when you try to run containers like docker or other LXC inside of it. It doesn’t have to but it definitely can. So you might wanna check that first. Also take in mind that you are limited to whatever Kernel the host is running.
Another issue that I encountered when working with docker on a rented vps is that my provider didn’t offer an external firewall so I just had to use ufw on the machine itself. not a big deal in general but my docker network was not affected by my firewall rules out of the box. i don’t remember exactly what was going on but I messed around with it and could solve that. Just something to look out for.
2gb will be probably insufficient, mainly because of Matrix Synapse. If you avoid joining any large communities it might work, but if you are not doing that you might as well use a XMPP server which is better anyways.
A small Lemmy instance will take around 500-1000mb RAM so that will likely work but use a significant portion of your RAM.
Thanks for the info. I wasn’t really able to find a clear answer elsewhere.
This is my droplet with 1GB of RAM only running lemmy:
free -m total used free shared buff/cache available Mem: 964 386 68 141 509 219 Swap: 2047 310 1737
So expect at least 1GB for lemmy with postgres included when you include spikes etc.
2 GB RAM might be a bit close for Postgres which you need for Matrix & Lemmy. And 25GB storage is not gonna last long at all for Lemmy + Matrix.
It took a minute to see that your title isn’t truncated automatically xD
AFAIK Synapse, which you use to run Matrix, is a huge resource hog. It would probably need +4GB RAM.
The heaviest things will probably be the postgres database(s) needed for nextcloud, vaultwarden, and lemmy. (not sure if invidious or matrix use dbs). I would say 500-1000MiB per DB, so probably around 4GiB to be safe.
Can’t you have multiple services using the same database? My understanding is that they would each do different tables and if you give each a different database user that’s not only good practice but also helps prevent them from stomping on eachother
You could, but it probably wouldn’t help much. The overhead for each additional Postgres server is minimal, the RAM usage comes from each database. It doesn’t really matter if those are on the same postgres instance or on separate ones, in my experience.
It’s always hard to evaluate that before, but why don’t you try setting all up and If it’s not enough RAM, just upgrade when needed? As @poVoq already said, Matrix might eat some of your 2g ram, everything else will probably not need so much.
I’ve been trying to, but I only get so far as the VPN. The moment I try setting up any other service, I consistently get a 502 bad gateway error on Nginx. I’m honestly at my wit’s end. I’ve nuked the server and will try again with a clean slate and hope for the best…
Maybe try Yunohost on it if you are starting fresh anyways.
Oh wow, will do! Do you know if it’s open source?
Yes, fully.
Fantastic!
If you want to host a matrix server with a low amount of RAM, you could consider using dendrite. It’s not complete yet, and not bug-free, but it’s a lot less heavy compared to synapse.
You could try Yunohost. It makes stuff a lot easier but like all those solutions makes real customizations more difficult.
I have the following running on mine:
- WireGuard
- NGINX
- go2social
- 2x static websites and a couple of fairly lightweight PHP sites
- AdGuard Home (provides DHCP and as blocking)
- Newsblur (in MultiPass container)
- Docker:
- Transmission
- Sonarr / Radarr / Lidarr / Prowlarr
- Huginn
- Plex
- Libreddit
- Linkding
- CalibreWeb
And probably a bunch of other stuff, but most of it lightweight.
Host has 16gb ram and 6gb in use.
8GB is needed for a “good experience”, you can go for 4 if you don’t join the massive rooms on Matrix
I have almost everything you listed running except An Invidious instance and your personal website ofc
- VPN Server: Practically nothing
- Nextcloud instance: 731 Mib
- Vaultwarden: 100 Mib
- Matrix home server & Database: 1.5 Gib
- Including bridges(Telegram, Whatsapp, Signal) and Element web 1.91 Gib
- Lemmy Instance: 200 Mib
Regarding storage: Matrix, Lemmy and Mastodon are gonna eat a lot of storage over time because they have to store media like pictures and videos. If you want i can look how much storage they use in total.
I am running Lemmy on mine with 1gb ram. 1 cpu. Ubuntu 22.04 server. I almost run out of ram. Seen as low as 50mb. Fwiw. My experience.
Probably will bump mine up.
Also, I found out my VPS host doesn’t allow smtp traffic (25 or 465)… Anyone got suggestions on hosts that are cheap, reputable that allow smtp?
Hetzner Cloud is cheap and EU based. They block smtp for new accounts, but you can turn off the smtp firewall after a month once you pay your first invoice. Otherwise, use a mail service like Sendgrid.
Hetzner is awesome, I’ve been using both their VMs and a Storage Box for my backups for years, never had any issues, reasonably priced as well!
Thanks for info!
Oracle Cloud Free Tier offers a lot for free, you need to add a credit card, but they have 2 x86 instances with 1GB RAM, and and up to 4 ARM instances with 24 GB cumulated RAM https://www.oracle.com/cloud/free/
Thanks for the info!