Skip to main content

Daily Workflow

Starting a session

Open a terminal and connect via SSH:

ssh -p 3434 abc@<server-ip>
# → Enter your SUDO_PASSWORD

Persistent sessions with tmux

tmux keeps your terminal sessions alive even if you disconnect, essential when working from a phone or an unstable connection.

Connect normally (no tmux):

ssh -p 3434 abc@<server-ip> # normal shell closing the terminal stops everything

Connect with tmux auto-attach:

Set environment variables when you SSH:

KeyValuePurpose
TMUX_AUTO1Auto-attach or create a tmux session on connect
TMUX_TIMEOUT2Kill detached session after N hours (-1=never, 0=on detach)
TMUX_AUTO=1 TMUX_TIMEOUT=2 ssh -p 3434 abc@<server-ip>
# → auto attached to tmux "main"
claude # runs inside tmux, survives disconnects

Next time you connect with the same variables, you're back in the same tmux session.

Apps like Termius

If you use Termius or similar apps, set these as host environment variables so you don't need to type them each time.

Key commands inside tmux:

ActionCommand
Detach (leave running)Ctrl+B then D
Scroll upCtrl+B then [ (arrows, q to quit)
New sessiontmux new -A -s name
List sessionstmux ls
Manual attach anytimeta (alias for tmux new -A -s main)
Kill current sessiontmux kill-session
Kill all sessionstmux kill-server
Kill all except currenttmux kill-session -a
Keep session forevertmux-keep prevents auto cleanup for this session
Override the timeout

Mid-task and realize you need more time? Run tmux-keep inside the tmux session. The cleanup daemon will skip it, it stays alive until you manually kill it, regardless of TMUX_TIMEOUT.

Working server side (no local setup needed)

You don't need a local machine. Everything runs on the server:

  • VS Code (browser): at http://<server-ip>:9090 standalone code-server, same files and environment
  • Terminal: SSH from anywhere (ssh -p 3434 abc@<server-ip>), or use the terminal in the web desktop
  • Claude Code / long tasks: inside tmux, survives disconnects
  • Files: live at /projects/, visible in all apps

Working locally (optional)

If you prefer editing files locally with automatic sync to the server:

  1. Open VS Code → open your workspace file
  2. Edit files normally
  3. When you switch away from a file, VS Code autosaves → Run on Save fires rsync --delete → changed files upload through SSH
  4. If you delete a file locally, rsync removes it from the server too
  5. The server is now an exact mirror of your local folder

See Local Setup for the full configuration.

Accessing from elsewhere

MethodURL / CommandAuth
Ubuntu Desktop (browser)http://<server-ip>:3000Password
VS Code, browserhttp://<server-ip>:9090Password
SSH from anywheressh -p 3434 abc@<server-ip>Password
SSH from iPhone (Termius)ssh -p 3434 abc@<server-ip> + set TMUX_AUTO=1Password

Ending a session

To end an SSH session, type exit or press Ctrl+D.

note

If the server reboots, your SSH session ends. Just run ssh -p 3434 abc@<server-ip> again.

tmux sessions survive disconnects but not server reboots. Reattach with tmux attach -t main after reboot.