Skip to content

Commit bdfa3b6

Browse files
committed
Review comments from @bpmct, sofa photo
1 parent 0cf2cdd commit bdfa3b6

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

posts/self-hosted-homelab/index.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,26 @@ author: Marc Paquette
66

77
# Run Coder in a self-hosted homelab
88

9-
I outgrew my little homelab. I have a couple of [ODROID-HC2](https://ameridroid.com/products/odroid-hc2) devices in a closet.
10-
11-
I use them to serve files and experiment with ARM assembly. They work great but they’re small, single board computers with equally small capacity.
9+
I outgrew my little homelab. I have a couple of [ODROID-HC2](https://ameridroid.com/products/odroid-hc2) devices in a closet. I use them to serve files and experiment with ARM assembly. They work great but they’re small, single board computers with matching small capacity.
1210

1311
It was time to expand my homelab to handle my dev projects too.
1412

1513
## My problem: I wasn't getting anywhere
1614

1715
I was spending too much time managing my personal and work projects instead of working on them. They're spread out over several environments and places. They run on OpenBSD, Windows, Linux, ARM, python3, browsers, and old-school command-line tools. The ODROIDs are almost literally chained to my homelab closet. I work from home, a co-work space, and sometimes other time zones.
1816

19-
The ideal solution would let me self-host my projects and work on them wherever and however I want. The machine I’m typing on right now is an OpenBSD laptop. I sometimes use a Windows laptop. I run Linux on the ODROIDs. And I also wanted to use an iPad for the [ultimate sofa software development rig](https://coder.com/blog/a-guide-to-writing-code-on-an-ipad).
17+
The ideal solution would let me self-host my projects and work on them wherever and however I want. The machine I’m typing on right now is an OpenBSD laptop. I sometimes use a Windows laptop. And I also wanted to use an iPad for the [ultimate sofa software development rig](https://coder.com/blog/a-guide-to-writing-code-on-an-ipad).
2018

2119
I put off fixing this because I expected that I'd have to hack and contort different tools into something that might eventually approach what I wanted. The cure seemed worse than the disease.
2220

2321
## I discovered Coder
2422

25-
It turns out that [Coder](https://coder.com) is a much easier solution. Coder solves big problems for big enterprise dev teams. And I discovered that it can solve my problem too:
23+
It turns out that [Coder](https://coder.com/docs/v2) is a much easier solution. Coder solves big problems for big enterprise dev teams. And I discovered that it can solve my problem too:
2624

2725
- An isolated workspace for each project, no matter the environment
2826
- Secure, remote access
29-
- Flexibility of handling cloud and on-prem projects
30-
- Administering all these projects from a single place
27+
- Flexibility of handling cloud and on-prem workspaces
28+
- Administering all these workspaces from a single place
3129
- Easy to install
3230
- Runs on modest hardware
3331
- Bonus: [Open source](https://github.com/coder)!
@@ -38,7 +36,7 @@ My homelab would need more hardware. I found a used [Lenovo m92P Tiny](https://w
3836

3937
[pic of Marvin and the rest of my homelab]
4038

41-
I installed Debian GNU/Linux and tucked Marvin into the homelab closet. Marvin’s only connection to the outside world is an ethernet cable.
39+
I installed [Debian](https://www.debian.org/intro/why_debian) and tucked Marvin into the homelab closet. Marvin’s only connection to the outside world is an ethernet cable.
4240

4341
## Install Docker then Coder
4442

@@ -61,7 +59,7 @@ deb package has been installed.
6159
marc@marvin:~$
6260
```
6361

64-
I wanted to dedicate Marvin to hosting my projects, so I followed the installer's suggestion to run Coder [as a service](https://coder.com/docs/v2/latest/admin/configure#system-packages):
62+
I wanted to dedicate Marvin to hosting my projects, so I followed the installer's suggestion to run Coder [as a system service](https://coder.com/docs/v2/latest/admin/configure#system-packages):
6563

6664
```bash
6765
marc@marvin:~$ sudo systemctl enable --now coder
@@ -89,11 +87,13 @@ At this point I was able to use my laptop's browser to log in to Coder. I opened
8987

9088
![Setting up an account](./static/account-setup.png)
9189

92-
Once logged in, I was ready to set up my first workspace. A Coder [workspace](https://coder.com/docs/v2/latest/workspaces) is a runnable environment that a developer, well, works in. Each developer has their own workspace (or workspaces).
90+
Once logged in, I was ready to set up my first workspace. A Coder [workspace](https://coder.com/docs/v2/latest/workspaces) is a runnable environment that a developer, well, develops in. Each developer has their own workspace (or workspaces).
91+
92+
A developer can connect to a workspace from their [favorite IDE](https://coder.com/docs/v2/latest/ides) and other dev tools. That includes browser-based [VS Code](https://coder.com/docs/code-server/latest), [LSP](https://langserver.org/) servers, and local JetBrains or Emacs.
9393

9494
Before I could start a workspace, I needed to create a [template](https://coder.com/docs/v2/latest/templates). A template is the collection of settings that Coder uses to create new workspaces. You only have to set up a template once to create as many workspaces as you need from it.
9595

96-
A Coder template is a [Terraform](https://www.terraform.io/) file. That means that a Coder workspace can be whatever you can provision with Terraform. For big dev teams, that can be as sophisticated as a [Kubernetes](https://coder.com/docs/v2/latest/platforms/kubernetes) cluster. For Marvin, I'll just be using Docker. But I could just as easily create a template for something simpler, like a [Python virtual environment](https://docs.python.org/3/library/venv.html).
96+
A Coder template is a [Terraform](https://www.terraform.io/) file. That means that a Coder workspace can be whatever you can provision with Terraform. For big dev teams, that can be as sophisticated as pods in a [Kubernetes](https://coder.com/docs/v2/latest/platforms/kubernetes) cluster. For Marvin, I'd just be using Docker.
9797

9898
Coder comes with a few templates out of the box. These templates include cloud computing like [Fly.io](https://coder.com/blog/remote-developer-environments-on-fly-io), Digital Ocean, Azure, Google Cloud, and AWS.
9999

@@ -129,17 +129,16 @@ Create your template by running:
129129
Examples provide a starting point and are expected to be edited!
130130
```
131131
132-
Normally I would have customized the template for one of my projects. I would have done that by editing the Terraform file, `main.tf`, in the `docker` directory:
132+
This starter template uses the vanilla [Ubuntu container image](https://hub.docker.com/_/ubuntu/). Normally I would have customized the template for one of my projects. I would have done that by editing the Terraform file, `main.tf`, in the `docker` directory:
133133
134134
```bash
135135
marc@marvin:~$ ls docker
136136
main.tf README.md
137137
```
138138
139-
This starter template uses the vanilla [Ubuntu container image](https://hub.docker.com/_/ubuntu/) and that's fine for now. So I just followed Coder's instructions to create the template:
139+
Next, I followed Coder's instructions to create the template:
140140

141141
```bash
142-
143142
marc@marvin:~$ cd ./docker && coder template create
144143
> Upload "~/docker"? (yes/no) yes
145144
# Progress info...
@@ -176,7 +175,7 @@ I filled in details about my first workspace then started it:
176175

177176
![Start my first workspace](./static/workspace-start.png)
178177

179-
Marvin took a couple of minutes as Coder prepared the workspace, including downloading the Docker image.
178+
Marvin took a couple of minutes as Coder prepared the workspace for the first time, including downloading the Docker image. After that starting the workspace would take only a few seconds.
180179

181180
That got me my first workspace, running and ready to use! I could access it in a few ways, including [code-server](https://coder.com/docs/code-server/latest), which lets me use VS Code in the browser.
182181

@@ -196,10 +195,10 @@ I can finally go places now that I can leave Marvin at home. Coder's public acce
196195

197196
And I can finally work on my projects however I want.
198197

199-
[ pic of Coder on an iPad ]
198+
![Ultimate sofa software development rig](./static/sofa-dev-rig.jpg)
200199

201200
For the next step, I'll set up some of my projects as Coder workspaces on my homelab:
202201

203-
* Put my static web site generator in a Docker image
204-
* Provision one of the ODROIDs as a Coder workspace
202+
* Static web site generator: Create a template with [persistence](https://coder.com/docs/v2/latest/templates/resource-persistence) and add [Pelican](https://getpelican.com/) to the template's Docker image.
203+
* ARM assembly: Create a template that provisions an ODROID.
205204

Loading

0 commit comments

Comments
 (0)