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:
| Key | Value | Purpose |
|---|---|---|
TMUX_AUTO | 1 | Auto-attach or create a tmux session on connect |
TMUX_TIMEOUT | 2 | Kill 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.
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:
| Action | Command |
|---|---|
| Detach (leave running) | Ctrl+B then D |
| Scroll up | Ctrl+B then [ (arrows, q to quit) |
| New session | tmux new -A -s name |
| List sessions | tmux ls |
| Manual attach anytime | ta (alias for tmux new -A -s main) |
| Kill current session | tmux kill-session |
| Kill all sessions | tmux kill-server |
| Kill all except current | tmux kill-session -a |
| Keep session forever | tmux-keep prevents auto cleanup for this session |
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>:9090standalone 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:
- Open VS Code → open your workspace file
- Edit files normally
- When you switch away from a file, VS Code autosaves → Run on Save fires
rsync --delete→ changed files upload through SSH - If you delete a file locally, rsync removes it from the server too
- The server is now an exact mirror of your local folder
See Local Setup for the full configuration.
Accessing from elsewhere
| Method | URL / Command | Auth |
|---|---|---|
| Ubuntu Desktop (browser) | http://<server-ip>:3000 | Password |
| VS Code, browser | http://<server-ip>:9090 | Password |
| SSH from anywhere | ssh -p 3434 abc@<server-ip> | Password |
| SSH from iPhone (Termius) | ssh -p 3434 abc@<server-ip> + set TMUX_AUTO=1 | Password |
Ending a session
To end an SSH session, type exit or press Ctrl+D.
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.