---
title: "Linux MiniPC for Remote Development"
description: "This post is about how I set up a Linux Ryzen MiniPC as a tool for Remote Development, using a Windows laptop as my main machine, but only as a thin client that connects to the MiniPC both locally and..."
publishedAt: 2024-05-16
locale: en
urlSlug: linux-minipc-untuk-remote-dev
isDraft: false
defaultLocale: en
---
[TOC]

This post is about how I set up a Linux Ryzen MiniPC as a tool for Remote Development, using a Windows laptop as my main machine, but only as a thin client that connects to the MiniPC both locally and globally through [Tailscale](https://tailscale.com/) VPN.

## A Little Context

![Office Laptop Dilemma](/static/my-office-laptop.jpg)

There are several main reasons why I needed an additional Linux machine for my daily coding workflow.

1. Involved in a project with multiple web services that communicate with each other. Being able to run all the services we develop on the local machine is a must for me, so I can be more productive by doing the [Inner Loop](#fn:1) first, before continuing with the team's Outer Loop (QA testing, then fixes by Developer).

2. The web service components vary widely from legacy PHP projects, Golang, MySQL database, Redis, and Elasticsearch. Running all these components is more comfortable through Docker or Podman, and of course needs sufficient RAM. At that time, I only had a MacBook Air 2017 with 8GB RAM (T_T).

3. Sometimes tinkering also needs to be done through a Virtual Machine. Why? To replicate infrastructure as closely as possible to production environment conditions, or to test an idea without polluting the host machine. In this case, I use [Multipass](https://braindump.fly.dev/notes/20210228151250-multipass/), which of course needs additional RAM.

https://twitter.com/AjeyGore/status/1772610018640105849

## Hardware Preparation

The cost I spent was around 8 million IDR, here's the breakdown:

1. Ryzen Mini PC [tokopedia](https://www.tokopedia.com/electronikjuragan/mini-pc-beelink-ser4-4800u-amd-ryzen-7-16-500gb-windows-11-home) price 6 million IDR
2. Upgrade RAM to 64 GB [tokopedia](https://www.tokopedia.com/harajuku-gaming/team-elite-so-dimm-memory-notebook-32-gb-ddr4-3200-mhz-black) price 2 million IDR

Of course, you can save more. I chose a mini PC because I was curious about the Ryzen 7 performance with 8 cores 16 threads, and it's compact, doesn't take up much space (*^_^*). For a more budget-friendly spec, you can copy from the tweet below.

https://twitter.com/garindrapp/status/1771013714067738991

## Software Preparation

### Tailscale

In short, two machines on separate networks can connect as long as they're both connected to Tailscale.

![VPN with Tailscale](https://talks.wayanjim.my.id/remote-dev-machine/assets/remote-dev-machine-diagram-DqTJQdBT.png)

My MiniPC is located in Bali, with Biznet Home Internet, while I currently live in Jakarta, and I can connect to the MiniPC in Bali by accessing the IP address obtained from Tailscale.

If you've never tried Tailscale, I highly recommend trying it, because in this case, this component is the most important.

### Setup SSH config

You can create an SSH config on Windows just like on Linux. This will make it easier to connect to the remote host through VSCode.
This file needs to be saved in `~/.ssh/config` or `C:\Users\<username>\.ssh\config` on Windows. Here's an example:

```ssh-config
Host ser4
    HostName 192.168.x.x
    User jimbo
```

Then, if you need to SSH to the MiniPC, you can use the command `ssh ser4`. You might need to setup `ssh-keygen` first and `ssh-copy-id` to avoid entering passwords every time.

### VSCode

1. Install Remote SSH Extension
2. Ctrl + Shift + P select Remote-SSH: Connect to Host
3. Select the Host name according to your SSH config
4. Open the project folder and terminal
5. Run services
6. Port Forward
7. Profit

### Mutagen.io

https://twitter.com/Sirupsen/status/1719319556882083943

This is just an alternative to VSCode Remote SSH & Port Forward. If you want to use Neovim, Mutagen also has port forwarding and file sync management features between remote and local. Here's an example, for more details you can check its [documentation](https://mutagen.io/).

```bash
# Sync file remote to local directory
mutagen sync create \
    --name=myproject ./project \
    ser4:~/clones/project --ignore-vcs

# Port forward
mutagen forward create \
    --name=ollama tcp:localhost:11434 \
    ser4:tcp:localhost:11434
```

### Tilt

Now, [Tilt](https://tilt.dev/) is like a glue that connects several supporting development components above:

1. source code
2. tasks like compile process or build container image
3. database services running in docker compose
4. deploy to local Kubernetes cluster (in my case)

and its web UI, in my opinion, really helps display logs when debugging.

![Tilt webui](https://gitlab.com/jimboylabs/commerce-asynq-gotenberg/-/raw/main/screenshots/screenshot-asynq-2.png)

## Experience So Far

Very satisfied!

1. Can install various services without worrying about running out of RAM. Docker or Podman, MySQL, Elasticsearch, Ollama, Local kubernetes with Kind, or Microk8s - everything in the MiniPC with 64GB RAM of course (〜￣▽￣)〜
2. Inner loop for early feedback more often, increasing confidence before throwing work to the outer loop
3. Saves laptop battery, because development workload is mostly handled by the MiniPC


[^fn:1]: [Developer Productivity Thoughts](https://sourcegraph.com/blog/developer-productivity-thoughts)
