Dev Server -- home mac mini or a large DO droplet? reddit / selfhosted ---------------------------------------------------------------------- life_on_my_terms 路 2023-09-29 17:56 Hi friends! I got a n00b question about self hosting and here's my dilemma: so I currently have a macbook air m1 for my personal use and developing software. At times I find it more convenient to spin up a DO droplet and develop things there cuz it's got dedicated ip and i can point a domain to it and run any number of small projects i have to test things out. So far the exp is ok, but often times the DO server is slow (i use a $32/month one, 2CPU, 8GB) and I'm thinking of upgrading to a $48/month one (4cpu, 8gb). My question is, would it be better off to just buy a Mac mini and use it as my dev server? I'm not sure what the implications are for running a server out of my home (security? bandwidth issues?) vs running a VPS, but VPS would cost me \~$600+ a year vs a $1500 mac mini (thats much performant than the VPS) that I get to keep. Let me know what you guys think of this situation! thanks! ---------------------------------------------------------------------- ElevenNotes 路 2023-09-29 18:22 If you have your own server you can stop developing on your client, so that's a win already. Plus you can add more stuff than you can do with a DO like clients and what not (as VMs or containers). Downside is no external access by default and no static IPv4 by default. You would have to set all of that up but it would make you a better developer because you finally understand what a network is. ---------------------------------------------------------------------- life_on_my_terms 路 2023-09-29 18:37 馃槀 \`You would have to set all of that up but it would make you a better developer because you finally understand what a network is.\` thats probably a very true statement, since i've been deferring those to devops / vps. I'm guessing services like Ngrok be useful to expose the homeserver to the internet right? ---------------------------------------------------------------------- TheParaPenguin 路 2023-09-29 18:41 Another alternative might be to look at different providers if you want to host externally, Hetzner or OVH for example. Both offer shared & dedicated options which are very competitively priced. Personally I use Hetzner for anything public facing, but also have a server in my house that needs a bit more power, or doesn't need to be exposed publicly. Is probably also worth mentioning that a Mac Mini wont be the best choice if you're buying something new to host at home, you could spend a lot less and still get great performance, if you want to match what you have in DO. ---------------------------------------------------------------------- TheParaPenguin 路 2023-09-29 18:45 Yup! ngrok or cloudflare tunnels (for http/https only) are good for exposing services to the internet with reduced attack surfaces, if you're hosting locally. ---------------------------------------------------------------------- boli99 路 2023-09-29 23:16 buy a machine to dev on at home get a $5/mo VPS proxy stuff via a VPN to your dev server, as and when you need to. then, when your dev product becomes a prod product - re-evaluate the situation accordingly. ---------------------------------------------------------------------- compuwar 路 2023-09-29 23:33 Buy a used PC, put Linux on it and set up Tailscale for remote access. Don鈥檛 forget to make regular offline/offsite backups. ---------------------------------------------------------------------- AK1174 路 2023-09-30 03:36 why a Mac mini? You could probably get a pc on resale for cheap, maybe do a memory upgrade if needed and remote work off that. ---------------------------------------------------------------------- TheRealSeeThruHead 路 2023-09-30 04:36 Cheap hp elitedesk with docker on Linux. 150$. Will do whatever that droplet does but better ---------------------------------------------------------------------- j0hnp0s 路 2023-09-30 04:54 You do not have to pay for a new macmini. Something with a 5 or 6 year-old i5 and 32 or 64GBs of RAM is going to give you an excellent development and even hosting experience. And it's gonna cost you a couple of hundred bucks. I am using G3 and G4 elitedesks at home and I feel like the things are flying. They are at least 10 times faster than my droplets and EC2 instances, and I don't have to deal with shared resources, cpu credits or throttling and all that crap ---------------------------------------------------------------------- TechyRyan33 路 2023-09-30 14:37 I have an old Intel box that I operate as my dev server. I just reverse proxy to it. It also hosts my code server so I can access and code away from home if I see one of my scripts doesn't run right. It also hosts my databases. And I like keeping them all on one box because I can back that up to another box that is backed up to the cloud. I've thought about asking family if I can host a server at their house and do backup there. ---------------------------------------------------------------------- life_on_my_terms 路 2023-09-30 14:57 ah didnt think of doing this this way, genius!!! ---------------------------------------------------------------------- mzinz 路 2023-09-30 16:23 How would you handle backups for that machine? ---------------------------------------------------------------------- TheRealSeeThruHead 路 2023-09-30 16:27 all my docker containers use bind mounts to local file system and that is backed up via duplicati but i'm about to switch the bind mounts to use a mounted network share on an external NAS device so i won't need any backups on this machine at all just an ansible script to install docker, mount the volumes from the network and run a docker compose file from a git repo the server could blow up and i wouldn't care ---------------------------------------------------------------------- mzinz 路 2023-09-30 16:29 That鈥檚 a cool idea. So would literally all of your docker related files live on the NAS? Docker-compose, DBs? ---------------------------------------------------------------------- TheRealSeeThruHead 路 2023-09-30 16:32 all my docker containers use bind mounts right now to the underlying file system so basically i just put fstab entries into my linux machine to mount network shares and then i bind mount the docker containers to folders withint the network share i haven't tried it yet but i don't forsee there being any issue i already bind mount network shares for media like plex libraries the docker compose would live in a git repo somewhere and can be cloned down to the linux host at any time (even better would be if you commit to git and then fire off a CI job to push the new compose file to the host) ---------------------------------------------------------------------- mzinz 路 2023-09-30 16:37 This is a great idea. I鈥檒l give it a try too. I love the idea of it being totally IaC from the docker compose and fstab. I do have concern about DB speed from NAS, will have to experiment with that ---------------------------------------------------------------------- TheRealSeeThruHead 路 2023-09-30 16:54 apparently sqlite is not recommended to be used over NFS if you nas can export iscsi block level network storage then you might like to use that instead. if you do keep data on the host you can run a periodic backup task via cron maybe script a restic command to move your local data to a remote with incremental backups ---------------------------------------------------------------------- mzinz 路 2023-09-30 18:46 Good to know. In that case, could store non-DB container data on NAS, but do containers requiring DBs locally as one option. Sort of a bummer to have snowflakes in that way though ---------------------------------------------------------------------- TheRealSeeThruHead 路 2023-09-30 19:07 If you store db data on zfs you can replicate via zfs to external at the file system level. I鈥檓 going to do that eventually. Way easier backup strategy imo ---------------------------------------------------------------------- PhilipLGriffiths88 路 2023-09-30 19:14 You could also use [zrok.io](https://zrok.io). It's an open source alternative which can be self-hosted or has a free SaaS. It also includes cool features like 'private sharing'. I work on the parent project ---------------------------------------------------------------------- Background_Long7372 路 2023-09-30 22:15 Cloudflare tunnel to proxy into home server, free with SSL. No need to pay for VPS ---------------------------------------------------------------------- life_on_my_terms 路 2023-10-02 14:23 mac mini just cuz the apple silicon chips are awesome and blazingly fast for dev and I'm already in the Apple ecosystem.