메뉴
HN
Hacker News • 35일 전

거의 완전한 자체 호스팅 샌드박스형 AI 소프트웨어 공장 구축기

IMP
7/10
핵심 요약

한 개발자가 자택 서버 위에 Coolify, Forgejo, Tailscale 등 오픈소스 도구만으로 LLM 에이전트가 프롬프트 하나만으로 저장소 생성, 코드·테스트 작성, CI 통과, Postgres 프로비저닝, HTTPS 배포까지 전체 소프트웨어 개발 주기를 자동으로 수행하는 환경을 구축한 경험담입니다. LLM에 머신 루트 권한을 주지 않고 전용 하드웨어와 네트워크 격리로 '구조적으로' 에이전트를 제어하는 접근이 핵심이며, 추가 비용은 월 2만원대 Codex 구독뿐입니다.

번역된 본문

거의 완전한 자체 호스팅, 샌드박스형, 에이전틱 소프트웨어 공장 구축하기

저는 (거의) 완전히 자체 호스팅되고, 샌드박스 처리된 에이전틱 소프트웨어 공장을 구축했습니다.

요약: 성공했습니다! 프롬프트 하나만으로 저장소를 만들고, 애플리케이션과 테스트를 작성하고, CI를 통과하고, Postgres를 프로비저닝하고, 제가 추가로 메시지를 보내지 않고도 완성된 앱을 HTTPS 뒤에 배포했습니다. 결과만 보고 싶다면 맨 아래에 데모 영상이 있습니다.

LLM이 다시 재미있어졌습니다! 원래 그랬던 걸 수도 있고, 제가 그냥 환멸의 골짜기에 갇혀 있었던 걸 수도 있겠네요. 요즘은 작은 도구가 필요하면 그냥 직접 만듭니다. 얼마 전 헬스장에서 무게 추적 앱이 갖고 싶어졌는데, 제가 생각한 앱은 완전히 전형적인 CRUD 앱이었지만 앱스토어 버전들은 모두 월 12파운드를 요구해서 Claude로 원샷으로 만들어버렸습니다. 아주 재미있었지만, 자동 모드에서 LLM에게 제 머신의 루트 접근 권한을 주는 건 여전히 마음에 걸립니다.

그래서 과제는 이렇습니다: LLM을 단순히 '신뢰'하는 대신 구조적으로 제한하면서, 완전히 원격에서 동작하는 에이전틱 개발 환경을 어떻게 만들 수 있을까? 저는 하나의 지시를 주면 에이전트가 전체 소프트웨어 개발 주기(SDLC)를 자율적으로 수행하기를 원합니다:

  • 사용할 기술 스택과 패키지 조사
  • 계획 수립 및 코드와 테스트 작성
  • Git 커밋, 빌드 및 CI 파이프라인 실행
  • 데이터베이스, 관측성(o11y), SSL이 있는 도메인을 갖춘 '프로덕션' 서버로 배포

전부 제 자택 서버에서, 클라우드 인프라 요금 한 푼 없이요. 이 실험의 유일한 지속 비용은 월 20파운드짜리 Codex 구독입니다.

서버

자랑스러운 제 서버들을 소개합니다. 아래쪽 것은 2014년형 듀얼코어 i3로, 5년째 홈랩으로 운영 중입니다. 이 블로그와 Pi-hole부터 Prometheus/Loki/Grafana 스택까지 약 45개의 Docker 컨테이너를 용감하게 호스팅하고 있죠. 라우터에서 포트 443도 포워딩되어 있습니다. LLM이 이걸 망가뜨리면 열받을 테니 오늘은 사용하지 않습니다.

위쪽 것은 2021년형 10세대 i7에 32GB RAM으로, eBay에서 새로 사서 아무것도 설치되지 않은 상태입니다. 완벽하죠.

기술 스택

핵심 개발 스택은 Coolify를 통해 자체 호스팅됩니다. 추론과 Tailscale, Telegram, DNS, ACME 같은 통합 기능은 여전히 외부로 나갑니다. 추론도 직접 호스팅할 수 있지만 저는 그런 하드웨어가 없고, OpenAI가 제 실험 비용을 보조해주는 게 더 낫습니다.

  • Pi-hole: 로컬 DNS 규칙, 그리고 짜증나는 광고를 덜 보는 부수 효과
  • Tailscale: 집 네트워크를 어디서든 따라다니게 해줌
  • Coolify: Docker 기반의 자체 호스팅 Heroku 스타일 PaaS
  • Forgejo (러너 포함): 자체 호스팅 Git 및 CI
  • Hermes (WebUI 포함): Codex를 추론에 사용하는 OpenClaw 스타일 가상 비서
  • Telegram: 화장실에서든 어디서든 에이전트와 대화
  • Firecrawl (자체 호스팅): 에이전트와 웹 사이의 스크래핑/변환 레이어
  • Porkbun (도메인 등록업체) & Let's Encrypt: 도메인과 실시간 SSL 인증서
  • 기타: Postgres, Redis 등 앱에 필요한 무엇이든. 결국 그 밑은 그냥 Docker니까요.

참고 자료

이건 완전한 설치 가이드가 아닙니다. Ansible 원샷 스크립트로 전체 설정을 정리할 수도 있을 것 같네요. 원하시면 아래 GitHub 저장소에 이슈를 남겨주세요. 여기까지 읽으셨다면 아마 스스로 해결하실 수 있을 겁니다.

  • Coolify 설정 블로그: 제 Hetzner 위 Coolify 설정 가이드
  • Coolify Dockerfiles: Coolify에서 실제로 동작하는 프로덕션 Dockerfile. 환경변수만 추가하면 됨
  • Forgejo Hermes Skill: Forgejo CLI용 Hermes 스킬. 키만 제공하면 됨

네트워킹

첫 번째 안전장치는 명확합니다: 전용 하드웨어에서 돌아간다는 점입니다. Hermes가 rm -rf /를 실행해도 최악의 경우 몇 시간 재구축하면 끝입니다.

다음 방어 계층은 네트워크입니다. 예전 서버는 라우터에서 포트 443이 포워딩되어 있지만, 이 서버는 아닙니다. 외부 유입(ingress)이 없어서 거대한 공격 표면과, 제가 설정한 모든 DNS A 레코드에 /wp-admin을 무작위로 탐색하는 인터넷의 온갖 백그라운드 노이즈가 차단됩니다. 하지만 유입이 없다면 어떻게 멋진 것들에 접근할 수 있을까요...

원문 보기
원문 보기 (영어)
Building an (almost) fully self-hosted, sandboxed, agentic software factory I built an (almost) fully self-hosted, sandboxed, agentic software factory. tl;dr: It worked! From one prompt it created a repo, wrote the application and tests, got CI green, provisioned Postgres and deployed the finished app behind HTTPS without another message from me.If you just wanna see the outcome you can find a demo video at the bottom LLMs got fun again! Maybe they always were and I was just stuck in the trough of disillusionment. Lately, whenever I need a little tool, I just build it. I was in the gym the other day and wanted a weights tracker. The app I had in mind was about as CRUD-y as it gets, but all the app store versions wanted £12 per month, so I just one-shotted one with Claude. Great fun, but giving an LLM root access to my machine in auto mode still doesn’t sit right with me. So, the challenge: how can I create a fully remote agentic development environment where we structurally contain the LLM rather than just trusting it? I want to give it an instruction and have it autonomously move through the whole SDLC: Researching the right stack and packages to use. Planning and writing the code and tests. Committing to Git, building and running a CI pipeline. Deploying the work to a ‘production’ server with databases, o11y, and a domain with SSL. All on my home server, without another cloud infrastructure bill. The only ongoing cost specific to this experiment is a £20 Codex sub. The Server(s) Here they are in all their glory. The one at the bottom is a 2014 dual-core i3 I’ve been running as a homelab for five years. It’s valiantly hosting this blog and about 45 other Docker containers, from Pi-hole to a full Prometheus / Loki / Grafana stack. It also has port 443 forwarded from my router. I’d be miffed if an LLM broke it, so that’s not what we’re using today. The top one is a 2021 10th-gen i7 with 32GB RAM, bought fresh from eBay with nothing on it. Perfect. The Stack The core development stack is self-hosted through Coolify. Inference and integrations like Tailscale, Telegram, DNS and ACME still leave the box. You could host inference too, but I don’t have the hardware and I’d rather OpenAI subsidise my experiments. Component Notes Pi-hole Local DNS rules, with the side benefit of seeing less shitty advertising. Tailscale Makes my home network follow me around. Coolify A self-hosted, Heroku-style PaaS built on Docker. Forgejo (with runners) Self-hosted Git and CI. Hermes (with WebUI) An OpenClaw-style virtual assistant, using Codex for inference. Telegram Talk to the agent from the toilet or wherever. Firecrawl (self-hosted) A scraping / translation layer between the agent and the web. Porkbun (Registrar) & Let’s Encrypt A domain and on-the-fly SSL certificates. Whatever else Postgres, Redis, whatever your apps need. It’s just Docker under the hood, innit? Sources This isn’t a full how-to guide. I could probably write an Ansible one-shot script to set it all up; leave an issue on the GitHub repo below if you’d like one. If you’ve read this far, though, you can probably figure it out. Source Notes Coolify Setup Blog My Coolify-on-Hetzner setup guide. Coolify Dockerfiles Production Dockerfiles that actually work on Coolify. Just add env vars. Forgejo Hermes Skill A Hermes skill for the Forgejo CLI; just provide a key. Networking The first guardrail is obvious: it’s on its own metal. Hermes could rm -rf / and at worst it would cost me a couple of hours rebuilding it. The next layer of bombproofing is the network. My older server has port 443 forwarded from the router; this one doesn’t. There’s no external ingress, cutting out a huge attack surface and all the internet background radiation from people speculatively probing /wp-admin on every DNS A record I set up. But, if there’s no ingress, how do I: Get access to all our cool new apps on my phone? Generate an SSL cert at a vanity URL so I can access https://cool-new-app.internal.jakeshomelab.me ? I have Tailscale set up with my older server as an exit node. When I’m away from home, selecting it routes my traffic through that server and Pi-hole, which I’m using for custom DNS. Pi-hole lets you add dnsmasq rules like this: address=/internal.jakeshomelab.me/192.168.1.201 Anything requesting *.internal.jakeshomelab.me now resolves to my new server, where Coolify’s reverse proxy picks it up and serves my shiny new services. SSL Certs With Caddy or Traefik and Docker labels, you can serve port 3000 on container X from https://my-service.internal.jakeshomelab.me . Point an A record at the server and it’ll contact Let’s Encrypt, complete an ACME challenge and get an SSL cert. I learned this three years ago and it still seems like magic. The problem is the A record. I don’t want to publicly associate my-service.internal.jakeshomelab.me with my IP, whether people can access it or not. I want an SSL cert for a ghost service. To solve this problem, I turned to DNS-01. I’ll be honest this is new to me, but here’s how it works: Buy a domain (in this case from Porkbun). Generate Porkbun API keys and add them to Coolify’s environment with write access to the domain. Modify Coolify’s Docker Compose file to use lego and the Porkbun API: - '--certificatesresolvers.letsencrypt.acme.dnschallenge=true' - '--certificatesresolvers.letsencrypt.acme.dnschallenge.provider=porkbun' - '--log.level=INFO' Then, when I register a new URL, Traefik / Coolify: Uses the Porkbun API to create a new TXT record at _acme-challenge.my-service.internal.jakeshomelab.me . Let’s Encrypt validates the challenge and issues a valid SSL cert. Traefik deletes it. That’s it! You now have a valid HTTPS URL, reachable within your tailnet, with no public A or AAAA record pointing to the service. The hostname may still appear in public certificate-transparency logs, but the service is only reachable from the tailnet. The best bit is that Coolify does this on the fly. Our agent can create a service at any subdomain and it’ll ✨magically✨ sort itself out. So, glue all this together and you get the following: The same setup covers the tooling, so Coolify, Hermes, Forgejo and Firecrawl all live on their own local subdomains. Development Stack & MCPs Now we have an isolated(ish) box, let’s move on to the tooling. The tools are well known; gluing them together is the fun part. Forgejo We need somewhere durable to store code and run CI. I decided not to use GitHub because: Giving the box my GitHub token rather undermines the isolation. Also, it’s not self-hosted. Its API and CI minute limits won’t work at the scale of our new software factory. It’s down most of the time these days anyway. Forgejo is a great self-hosted alternative. The Docker Compose file linked above sets up Forgejo and its runners; registering yourself and the runner takes a little extra work, but it’s well documented. I’ve also included a Compose file for syncing projects back to GitHub. That puts your GH token in the environment, but the trade-off is yours to make. The Forgejo Hermes skill linked above gives the agent full control of the instance. Hermes Hermes is an OpenClaw-style personal assistant with agentic capabilities. I never got in on the OpenClaw hype, so I can’t compare the two, but Hermes has a few features I’ve found handy: Web UI : A standard ChatGPT-esque interface for working from my laptop and managing skills. Shared filesystem : I’ve mounted its workspace from the Docker host and shared it over Samba. The agent and I can use the same files instead of copy-pasting Markdown and code around. Telegram integration : I can chat to the agent from my phone. Setup took two minutes and required no login details, which suited the sandbox approach. Self-