<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Andrey Markin</title>
    <description>The latest articles on DEV Community by Andrey Markin (@andrey_markin).</description>
    <link>https://dev.to/andrey_markin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4071920%2Ff79d5290-4f63-4e62-bbd4-7760ca3a4d12.jpg</url>
      <title>DEV Community: Andrey Markin</title>
      <link>https://dev.to/andrey_markin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andrey_markin"/>
    <language>en</language>
    <item>
      <title>Claude Code on VPS: Full Setup to Code from Your Phone</title>
      <dc:creator>Andrey Markin</dc:creator>
      <pubDate>Mon, 10 Aug 2026 20:13:51 +0000</pubDate>
      <link>https://dev.to/andrey_markin/claude-code-on-vps-full-setup-to-code-from-your-phone-5hhp</link>
      <guid>https://dev.to/andrey_markin/claude-code-on-vps-full-setup-to-code-from-your-phone-5hhp</guid>
      <description>&lt;p&gt;Complete guide to setting up Claude Code on a private VPS with Tailscale security, Tmux persistence, and Caddy HTTPS – code from anywhere, even your phone.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5uurmoze85ev60y7pw7i.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5uurmoze85ev60y7pw7i.webp" alt="Abstraction image representing mobile phone and secure connection to the server" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;I wanted to code from my phone. Not "review PRs" or "edit a config file" – actually run Claude Code, iterate on features, and preview changes in the browser. Turns out a $7/mo VPS is all you need.&lt;/p&gt;

&lt;p&gt;This guide covers the full stack: Hetzner VPS, Tailscale for zero-trust SSH, Tmux for persistent sessions, and Caddy for HTTPS dev server access. By the end you'll have a setup where you SSH in from your phone, attach a Tmux session with Claude Code already running, and preview your app at &lt;code&gt;https://dev.yourdomain.com&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architecture Overview
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdv96gqn28f17s59mmcdu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdv96gqn28f17s59mmcdu.png" alt="Claude Code on VPS with Tailscale architecture mermaid diagram" width="800" height="759"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The setup has 5 moving parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hetzner VPS&lt;/strong&gt; – cheap, fast, EU/US datacenters. The machine where everything runs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tailscale&lt;/strong&gt; – mesh VPN. SSH traffic goes over encrypted Tailscale tunnel, never over public internet&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Terminus&lt;/strong&gt; – SSH client for iOS/Android/desktop. Connects to VPS via Tailscale IP&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tmux&lt;/strong&gt; – terminal multiplexer. Sessions persist when you disconnect. Phone goes to sleep? Claude keeps working&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Caddy&lt;/strong&gt; – reverse proxy with automatic HTTPS. Exposes &lt;code&gt;localhost:3000&lt;/code&gt; at &lt;code&gt;https://dev.yourdomain.com&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  VPS Setup
&lt;/h2&gt;

&lt;p&gt;Go to &lt;a href="https://www.hetzner.com/cloud/" rel="noopener noreferrer"&gt;Hetzner Cloud&lt;/a&gt;, create a project, spin up a server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Location&lt;/strong&gt;: closest datacenter to you&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image&lt;/strong&gt;: Latest Ubuntu&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Type&lt;/strong&gt;: min: CX22 (2 vCPU, 4GB RAM, IPv4) – ~$7/mo, enough for me, but you choose you. If you run big projects and lots of parallel Claude instances, i would advise you get more memory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hetzner sends the root password to your email. SSH in as root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh root@&amp;lt;your-server-ip&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll be prompted to change the root password immediately on first login.&lt;/p&gt;

&lt;h3&gt;
  
  
  Non-Root User
&lt;/h3&gt;

&lt;p&gt;Claude Code with &lt;code&gt;--dangerously-skip-permissions&lt;/code&gt; refuses to run as root. Create a dedicated user:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;adduser agent
usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;agent

&lt;span class="c"&gt;# Copy your SSH key to the new user&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /home/agent/.ssh
&lt;span class="nb"&gt;cp&lt;/span&gt; ~/.ssh/authorized_keys /home/agent/.ssh/
&lt;span class="nb"&gt;chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; agent:agent /home/agent/.ssh
&lt;span class="nb"&gt;chmod &lt;/span&gt;700 /home/agent/.ssh
&lt;span class="nb"&gt;chmod &lt;/span&gt;600 /home/agent/.ssh/authorized_keys

&lt;span class="c"&gt;# Switch to agent&lt;/span&gt;
su - agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From now on, everything runs as &lt;code&gt;agent&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Claude Code
&lt;/h3&gt;

&lt;p&gt;Install Claude Code early – it can help you configure everything else on the server (Tailscale, firewall, shell, tooling, etc.).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install Claude Code&lt;/span&gt;
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://claude.ai/install.sh | bash

&lt;span class="c"&gt;# First run – authenticates via browser&lt;/span&gt;
claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Follow the auth link. Once authenticated, you can use Claude Code to help with the remaining setup steps – or follow the guide manually.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tailscale
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://tailscale.com/" rel="noopener noreferrer"&gt;Tailscale&lt;/a&gt; creates a zero-trust mesh VPN between your devices. Free for personal use (up to 100 devices). Every device gets a stable &lt;code&gt;100.x.x.x&lt;/code&gt; IP that works everywhere.&lt;/p&gt;

&lt;p&gt;Install on VPS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://tailscale.com/install.sh | sh
&lt;span class="nb"&gt;sudo &lt;/span&gt;tailscale up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Follow the auth URL to link the VPS to your Tailscale account. Note the &lt;code&gt;100.x.x.x&lt;/code&gt; IP – that's your SSH target from now on.&lt;/p&gt;

&lt;p&gt;Install Tailscale on your phone/desktop too. Once both devices are on the same Tailnet, they can reach each other directly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Firewall (ufw)
&lt;/h3&gt;

&lt;p&gt;Lock down the VPS. Only expose what's needed.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ufw&lt;/code&gt; is just a friendly front-end for the kernel's netfilter firewall – it isn't included on many minimal/VPS base images, so install it first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; ufw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On other distros: &lt;code&gt;sudo dnf install -y firewalld&lt;/code&gt; on RHEL/Fedora/CentOS/Rocky/Alma (or install &lt;code&gt;ufw&lt;/code&gt; from EPEL), &lt;code&gt;sudo apk add ufw&lt;/code&gt; on Alpine. The walkthrough below assumes Ubuntu/Debian.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lockout warning&lt;/strong&gt;: the rule below allows SSH &lt;strong&gt;only&lt;/strong&gt; over the &lt;code&gt;tailscale0&lt;/code&gt; interface. If Tailscale isn't connected when you enable the firewall, you'll be locked out of the VPS. Before running &lt;code&gt;sudo ufw enable&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install &lt;code&gt;ufw&lt;/code&gt; (above)&lt;/li&gt;
&lt;li&gt;Confirm Tailscale is up: &lt;code&gt;tailscale status&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Open a second SSH session to the Tailscale IP (&lt;code&gt;100.x.x.x&lt;/code&gt;) and keep it open – it's your safety net if a rule is wrong&lt;/li&gt;
&lt;li&gt;Add the rules&lt;/li&gt;
&lt;li&gt;Then enable the firewall
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Allow SSH only over Tailscale interface&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow &lt;span class="k"&gt;in &lt;/span&gt;on tailscale0 to any port 22

&lt;span class="c"&gt;# Allow HTTPS from anywhere (for Caddy dev server)&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 443/tcp

&lt;span class="c"&gt;# Enable firewall&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw &lt;span class="nb"&gt;enable&lt;/span&gt;

&lt;span class="c"&gt;# Verify&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result: SSH is only accessible via Tailscale tunnel. Port 443 is open for the HTTPS dev server. Everything else is blocked.&lt;/p&gt;




&lt;h2&gt;
  
  
  Terminus SSH Client
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://termius.com/" rel="noopener noreferrer"&gt;Terminus&lt;/a&gt; is a cross-platform SSH client – works on iOS, Android, macOS, Windows. It's the best mobile SSH experience I've found.&lt;/p&gt;

&lt;p&gt;Setup:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Terminus on your phone and/or desktop&lt;/li&gt;
&lt;li&gt;Create a new host:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Address&lt;/strong&gt;: your VPS Tailscale IP (&lt;code&gt;100.x.x.x&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Username&lt;/strong&gt;: &lt;code&gt;agent&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auth&lt;/strong&gt;: SSH key (import your private key)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Connect – you're in&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Tmux
&lt;/h2&gt;

&lt;p&gt;This is the critical piece. Without Tmux, closing your SSH connection (or your phone going to sleep) kills whatever's running. With Tmux, processes keep running on the server – you just detach and reattach.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; tmux
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr5ggw68mhwokrx5csb8e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr5ggw68mhwokrx5csb8e.png" alt="Tmux resumable sessions mermaid diagram" width="800" height="1382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Essential Commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create named session (name it after your project)&lt;/span&gt;
tmux new &lt;span class="nt"&gt;-s&lt;/span&gt; project1

&lt;span class="c"&gt;# Detach from session (keeps it running)&lt;/span&gt;
&lt;span class="c"&gt;# Ctrl+B, then D&lt;/span&gt;

&lt;span class="c"&gt;# List sessions&lt;/span&gt;
tmux &lt;span class="nb"&gt;ls&lt;/span&gt;

&lt;span class="c"&gt;# Attach to existing session&lt;/span&gt;
tmux a &lt;span class="nt"&gt;-t&lt;/span&gt; project1

&lt;span class="c"&gt;# Kill a session&lt;/span&gt;
tmux kill-session &lt;span class="nt"&gt;-t&lt;/span&gt; project1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Parallel Workflow
&lt;/h3&gt;

&lt;p&gt;Use one tmux session per project. Claude Code starts the dev server itself (in a background tmux session or via its built-in tools), so you just need one session to interact with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Project 1: your main project&lt;/span&gt;
tmux new &lt;span class="nt"&gt;-s&lt;/span&gt; project1
&lt;span class="nb"&gt;cd&lt;/span&gt; ~/project1
claude

&lt;span class="c"&gt;# Detach: Ctrl+B, D&lt;/span&gt;

&lt;span class="c"&gt;# Project 2: another project&lt;/span&gt;
tmux new &lt;span class="nt"&gt;-s&lt;/span&gt; project2
&lt;span class="nb"&gt;cd&lt;/span&gt; ~/project2
claude

&lt;span class="c"&gt;# Detach: Ctrl+B, D&lt;/span&gt;

&lt;span class="c"&gt;# Switch between projects:&lt;/span&gt;
tmux a &lt;span class="nt"&gt;-t&lt;/span&gt; project1
tmux a &lt;span class="nt"&gt;-t&lt;/span&gt; project2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each project gets its own session. Claude handles dev servers, builds, and other processes within the session. Switch between projects as needed – everything survives SSH disconnects.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Parallel changes on the same repo?&lt;/strong&gt; Use &lt;a href="https://git-scm.com/docs/git-worktree" rel="noopener noreferrer"&gt;git worktrees&lt;/a&gt;. Worktrees let you check out multiple branches of the same repo into separate directories, so two Claude instances can work on different features simultaneously without conflicts:&lt;/p&gt;


&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/project1
git worktree add ../project1-feature-b feature-b
&lt;span class="c"&gt;# Now run a separate tmux session for the worktree&lt;/span&gt;
tmux new &lt;span class="nt"&gt;-s&lt;/span&gt; project1-feature-b
&lt;span class="nb"&gt;cd&lt;/span&gt; ~/project1-feature-b
claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Configuration
&lt;/h3&gt;

&lt;p&gt;Optional but recommended &lt;code&gt;.tmux.conf&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/.tmux.conf&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Mouse support (useful for scrolling)&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; mouse on
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reload with &lt;code&gt;tmux source-file ~/.tmux.conf&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Shell &amp;amp; Tooling
&lt;/h2&gt;

&lt;p&gt;Install the tools you'll need on the VPS. Here's what I'd recommend:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;zsh&lt;/strong&gt; + oh-my-zsh – better shell experience, autocompletions, plugins&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;git&lt;/strong&gt; – version control, obviously&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;gh&lt;/strong&gt; (GitHub CLI) – create PRs, open issues, review checks, all from the terminal&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;docker&lt;/strong&gt; – if you run database instances, Redis, or other services locally&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;nvim&lt;/strong&gt; – if you want to edit files in vim mode directly on the server&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dev runtimes&lt;/strong&gt; – depends on your stack: bun, nvm (Node), python, uv, go, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once your shell is set up, add this alias to your &lt;code&gt;.zshrc&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/.zshrc&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;cc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'claude --dangerously-skip-permissions'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This runs Claude Code in fully autonomous mode – no approval prompts for commands or file changes. Much better for async workflows where you kick off a task and come back later. But be cautious: in this mode Claude can do anything without asking, including pushing to main, running database migrations, deleting files, etc. Use it when you trust the task scope.&lt;/p&gt;




&lt;h2&gt;
  
  
  Project Config
&lt;/h2&gt;

&lt;p&gt;Set up &lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt; so Claude Code understands your preferences from the start. This global config applies to all projects:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Claude Code Rules&lt;/span&gt;

&lt;span class="gu"&gt;## Environment&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Platform**&lt;/span&gt;: VPS accessed via SSH from multiple devices
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Shell**&lt;/span&gt;: zsh
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Session management**&lt;/span&gt;: tmux (always assume running inside tmux)

&lt;span class="gu"&gt;## Communication Style&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Concise and direct response. Sacrifice grammar for the sake of concision.
&lt;span class="p"&gt;-&lt;/span&gt; Minimal explanation unless asked
&lt;span class="p"&gt;-&lt;/span&gt; No emojis

&lt;span class="gu"&gt;## Tmux Workflow&lt;/span&gt;
Since this is a VPS environment with SSH access from multiple devices, use tmux sessions for process isolation:
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="gs"&gt;**Long-running processes**&lt;/span&gt; (dev servers, watchers, builds): Create new tmux sessions
  &lt;span class="p"&gt;```&lt;/span&gt;&lt;span class="nl"&gt;bash
&lt;/span&gt;  tmux new-session &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; &amp;lt;name&amp;gt; &lt;span class="s1"&gt;'&amp;lt;command&amp;gt;'&lt;/span&gt;
  &lt;span class="p"&gt;```&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Naming convention**&lt;/span&gt;: &lt;span class="sb"&gt;`{project}-{purpose}`&lt;/span&gt; (e.g., &lt;span class="sb"&gt;`myapp-dev`&lt;/span&gt;, &lt;span class="sb"&gt;`api-build`&lt;/span&gt;) - prefix with repo/project name to avoid collisions across parallel instances
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Checking output**&lt;/span&gt;: Use &lt;span class="sb"&gt;`tmux capture-pane -t &amp;lt;session&amp;gt; -p`&lt;/span&gt; to read session output
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Listing sessions**&lt;/span&gt;: &lt;span class="sb"&gt;`tmux list-sessions`&lt;/span&gt;

This allows reconnecting from any device and finding all processes still running in their respective sessions.

&lt;span class="gu"&gt;## Tools Available&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; git, gh (GitHub CLI)
&lt;span class="p"&gt;-&lt;/span&gt; Standard Unix tools
&lt;span class="p"&gt;-&lt;/span&gt; oh-my-zsh

&lt;span class="gu"&gt;## Plan Mode&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Make the plan extremely concise. Sacrifice grammar for the sake of concision.
&lt;span class="p"&gt;-&lt;/span&gt; At the end of each plan, give me a list of unresolved questions to answer, if any.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;You can adjust Tools Available section to include your coding environment like Bun, UV, etc.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The key VPS-specific addition is the &lt;strong&gt;Tmux Workflow&lt;/strong&gt; section – it tells Claude Code to spin up long-running processes in separate tmux sessions instead of blocking the current terminal. This way Claude creates &lt;code&gt;myapp-dev&lt;/code&gt; sessions for dev servers, and you can check their output or reattach from any device.&lt;/p&gt;

&lt;p&gt;You can also add per-project &lt;code&gt;CLAUDE.md&lt;/code&gt; files in each repo root for project-specific commands, architecture notes, and patterns. Claude Code reads both files automatically on startup. The easiest way to call /init inside Claude Code running in the project folder.&lt;/p&gt;




&lt;h2&gt;
  
  
  HTTPS Dev Server
&lt;/h2&gt;

&lt;p&gt;Problem: Claude Code starts &lt;code&gt;bun dev&lt;/code&gt; on &lt;code&gt;localhost:3000&lt;/code&gt;, but you can't hit localhost from your phone browser. Solution: Caddy reverse proxy with automatic SSL.&lt;/p&gt;

&lt;h3&gt;
  
  
  DNS Setup
&lt;/h3&gt;

&lt;p&gt;In your domain's DNS settings, add an A record:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;DNS Record&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Type: A
Name: dev
Value: &amp;lt;your-vps-public-ip&amp;gt;
TTL: 300
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This points &lt;code&gt;dev.yourdomain.com&lt;/code&gt; to your VPS public IP.&lt;/p&gt;

&lt;h3&gt;
  
  
  Caddy Setup
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://caddyserver.com/" rel="noopener noreferrer"&gt;Caddy&lt;/a&gt; handles HTTPS automatically – it provisions Let's Encrypt certificates with zero config.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install Caddy&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; debian-keyring debian-archive-keyring apt-transport-https curl
curl &lt;span class="nt"&gt;-1sLf&lt;/span&gt; &lt;span class="s1"&gt;'https://dl.cloudsmith.io/public/caddy/stable/gpg.key'&lt;/span&gt; | &lt;span class="nb"&gt;sudo &lt;/span&gt;gpg &lt;span class="nt"&gt;--dearmor&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl &lt;span class="nt"&gt;-1sLf&lt;/span&gt; &lt;span class="s1"&gt;'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt'&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/apt/sources.list.d/caddy-stable.list
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;caddy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Configure the Caddyfile:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/etc/caddy/Caddyfile&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dev.yourdomain.com {
    reverse_proxy localhost:3000
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the entire config. Caddy auto-provisions SSL and reverse-proxies to your dev server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Restart Caddy to pick up changes&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart caddy

&lt;span class="c"&gt;# Check status&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status caddy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now when Claude starts &lt;code&gt;bun dev&lt;/code&gt; in a Tmux session, open &lt;code&gt;https://dev.yourdomain.com&lt;/code&gt; on your phone – live preview of your app with hot reload.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security note&lt;/strong&gt;: only port 443 is publicly exposed (for the HTTPS dev server). SSH stays locked behind Tailscale. If you don't need public HTTPS access, you can skip Caddy entirely and access the dev server over Tailscale too (&lt;code&gt;http://100.x.x.x:3000&lt;/code&gt;).&lt;/p&gt;




&lt;h2&gt;
  
  
  Full Workflow
&lt;/h2&gt;

&lt;p&gt;End-to-end, here's what coding from your phone looks like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Open Terminus&lt;/strong&gt; on your phone&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSH into VPS&lt;/strong&gt; via Tailscale IP&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Attach Tmux session&lt;/strong&gt;: &lt;code&gt;tmux a -t project1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Talk to Claude Code&lt;/strong&gt; – describe the feature, fix, or change&lt;/li&gt;
&lt;li&gt;You can close the app and break the connection. Claude edits files, runs commands, iterates&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preview changes&lt;/strong&gt;: open &lt;code&gt;https://dev.yourdomain.com&lt;/code&gt; in phone browser&lt;/li&gt;
&lt;li&gt;Sessions keep running – come back anytime from any device&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can also run this from desktop with the same setup. The VPS becomes your persistent dev environment that you access from anywhere.&lt;/p&gt;




&lt;h2&gt;
  
  
  Telegram Bot Interface
&lt;/h2&gt;

&lt;p&gt;I've been building a &lt;a href="https://github.com/Mark-Life/telegram-claude" rel="noopener noreferrer"&gt;Telegram bot&lt;/a&gt; that acts as a chat interface to Claude Code on the VPS. Instead of opening an SSH client, you just message the bot from Telegram – it spawns Claude Code in the selected project directory and streams results back.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa1zouc1ejj8izqa8jbma.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa1zouc1ejj8izqa8jbma.png" alt="telegram client to server to claude relation digram" width="800" height="139"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Key features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Project switching&lt;/strong&gt; – select which project directory to work in via inline keyboard&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Voice messages&lt;/strong&gt; – record a voice note describing what you want, the bot transcribes it (via Groq Whisper) and feeds it to Claude Code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streaming responses&lt;/strong&gt; – live-updated Telegram messages as Claude works&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conversation continuity&lt;/strong&gt; – follow-up messages reuse the same Claude session&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost tracking&lt;/strong&gt; – each response shows token cost and duration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The workflow becomes: open Telegram, pick a project, describe a feature or fix (type or voice), and Claude Code does the work – edits files, runs commands, creates PRs. You get the output streamed back as Telegram messages.&lt;/p&gt;

&lt;p&gt;It's built with TypeScript, Bun, and &lt;a href="https://grammy.dev/" rel="noopener noreferrer"&gt;grammY&lt;/a&gt;. The project is &lt;a href="https://github.com/Mark-Life/telegram-claude" rel="noopener noreferrer"&gt;open source&lt;/a&gt; – still early and has some rough edges, but I already use it daily for real work. Voice messages in particular make it feel like you're just talking to your dev environment.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tips &amp;amp; Troubleshooting
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Claude Code is slow / OOM&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;4GB RAM is tight if the project is large. Upgrade to CX32 (8GB) if needed&lt;/li&gt;
&lt;li&gt;Close unused Tmux sessions to free memory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;SSH connection drops frequently&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add to your SSH config:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;~/.ssh/config&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ~/.ssh/config
Host vps
  HostName 100.x.x.x
  User agent
  ServerAliveInterval 60
  ServerAliveCountMax 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Caddy not getting SSL cert&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verify DNS A record points to VPS public IP&lt;/li&gt;
&lt;li&gt;Check port 443 is open: &lt;code&gt;sudo ufw status&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Check Caddy logs: &lt;code&gt;sudo journalctl -u caddy&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Tmux session lost scroll history&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increase &lt;code&gt;history-limit&lt;/code&gt; in &lt;code&gt;.tmux.conf&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;Ctrl+B, [&lt;/code&gt; to enter scroll mode, &lt;code&gt;q&lt;/code&gt; to exit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Phone keyboard tips&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Terminus supports custom key mappings – map Ctrl, Escape, etc.&lt;/li&gt;
&lt;li&gt;Use Tmux prefix &lt;code&gt;Ctrl+A&lt;/code&gt; (easier to reach than &lt;code&gt;Ctrl+B&lt;/code&gt; on phone keyboards)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Security checklist&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSH accessible only via Tailscale (never on public IP)&lt;/li&gt;
&lt;li&gt;Keep system updated: &lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Tailscale ACLs for extra lockdown if sharing the Tailnet&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How much does it cost to run Claude Code on a VPS?
&lt;/h3&gt;

&lt;p&gt;~$7/mo for a Hetzner CX22 VPS + Claude Code subscription ($20/mo for Pro, $100/mo for Max, $200/mo for 10xMax). Tailscale is free for personal use. Total: $27–207/mo depending on your Claude plan.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I run Claude Code on AWS, DigitalOcean, or Linode instead of Hetzner?
&lt;/h3&gt;

&lt;p&gt;Yes. Any Ubuntu VPS with SSH access works. I use Hetzner personally, but DigitalOcean, Linode, and Vultr all work the same way. AWS EC2 works too but is more complex to set up and usually more expensive for equivalent specs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do I need Tailscale for VPS SSH, or is regular SSH enough?
&lt;/h3&gt;

&lt;p&gt;I strongly recommend Tailscale. Exposing SSH on a public IP – even with key auth – means your server is one unpatched Ubuntu vulnerability away from being compromised. With Tailscale, the SSH port is never exposed to the public internet. There's nothing to scan, nothing to brute-force, no attack surface. You also get stable IPs across networks (home WiFi, mobile data, coffee shop) without port forwarding or dynamic DNS. Tailscale + ufw firewall is the baseline I'd consider safe for a development VPS.&lt;/p&gt;

&lt;h3&gt;
  
  
  What VPS specs do I need for Claude Code? (CPU, RAM, storage)
&lt;/h3&gt;

&lt;p&gt;2 vCPU / 4GB RAM handles one Claude Code instance and a dev server fine for small-to-medium projects. For larger projects or running multiple Claude instances in parallel, go 4 vCPU / 8GB RAM. Disk is rarely the bottleneck – 40GB is plenty unless you're running Docker images.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use VS Code Remote SSH with Claude Code?
&lt;/h3&gt;

&lt;p&gt;Yes, VS Code Remote SSH works over Tailscale. But you lose the main benefit – working from your phone. The terminal-only workflow is intentional: Claude Code does the editing, you just direct it. If you prefer visual editing, VS Code Remote SSH + Cursor is a valid alternative for desktop.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is Claude Code &lt;code&gt;--dangerously-skip-permissions&lt;/code&gt; safe to use?
&lt;/h3&gt;

&lt;p&gt;I run everything with &lt;code&gt;--dangerously-skip-permissions&lt;/code&gt;. The reason it works for me: this is a VPS, not my personal laptop. If Claude somehow destroys the environment, I don't lose anything irreplaceable – only project files (backed by git) and dev-only environment variables. No production credentials, no personal data.&lt;/p&gt;

&lt;p&gt;That said, in this mode Claude can theoretically run &lt;code&gt;rm -rf&lt;/code&gt;, &lt;code&gt;git push --force&lt;/code&gt;, or drop a database without asking. To mitigate this, Claude Code supports &lt;a href="https://docs.anthropic.com/en/docs/claude-code/hooks" rel="noopener noreferrer"&gt;hooks&lt;/a&gt; – shell scripts that intercept commands before execution. You can set up safeguards like: block &lt;code&gt;rm -rf /&lt;/code&gt; patterns, prevent &lt;code&gt;git push --force&lt;/code&gt; to main, or enforce &lt;code&gt;drizzle-kit migrate&lt;/code&gt; instead of &lt;code&gt;drizzle-kit push&lt;/code&gt;. Hooks give you the speed of autonomous mode with guardrails where they matter.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to set up a shared VPS for multiple developers with Claude Code?
&lt;/h3&gt;

&lt;p&gt;Create separate Linux users, each with their own home directory, tmux sessions, and Claude Code auth. Tailscale ACLs can restrict who can SSH in. Each user's projects stay isolated.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>webdev</category>
      <category>claude</category>
    </item>
  </channel>
</rss>
