Vibe Coding Academy | VPS Setup Guide

Run Claude Code from Your Phone

A step-by-step guide to setting up a cloud VPS, securing it with SSH keys, and accessing Claude Code on the go on your Phone.

Step 1

Set Up a Cloud VPS

You cannot run Claude Code directly on a phone's native operating system, so you need to set up a Virtual Private Server (VPS) to host it.

Hostinger homepage
VPS plan selection
Search Claude Code OS
Claude Code OS image
OS image selected
Account creation
Set password
Malware scanner
Step 2

Access and Secure the Terminal

VPS dashboard

Once the VPS is running, access the terminal via the browser button on the Hostinger dashboard to perform initial security setup.

Browser terminal

Now you're in. Type claude to verify Claude Code is available.

Type claude

You now have access to Claude on your VPS. Select your login method and authenticate.

Login method
Authorize
Logged in

Exit Claude and return to the terminal so we can run some security commands.

Exit Claude

Install Fail2Ban

Block brute force attacks:

sudo apt install fail2ban -y
Install fail2ban

Check that it is running:

systemctl status fail2ban
Fail2ban status

Configure Firewall (UFW)

Enable the firewall and allow SSH traffic (port 22):

sudo ufw allow 22 && sudo ufw enable
If you are root, sudo may not be strictly necessary, but it is good practice.
UFW setup
Step 3

Connect via Mobile App

To access this terminal from your phone, you need a terminal application.

Termius app store
Create host
VPS IP address

Label the connection (e.g., "Claude Code").

Label connection

Scroll down and create an identity for username and password (same as your server password).

Create identity

You should then be able to login to the server from your phone.

Login from phone
Claude on phone
Step 4

Set Up SSH Key Authentication

To improve security and convenience, replace password logins with SSH keys.

First, exit Claude Code and close the connection.

Exit Claude
Close connection
Generate key
Name the key

Once the key has been generated, hold down your finger on the new key and tap "Share."

Share key
Export to host
Step 5

Disable Password Authentication

Once the key works, disable password access entirely to harden security.

Remove the password from the identity you created in Termius. If you cannot find your identity, check your keychains (accessible from the Termius main menu).

Remove password

Disable password authentication (SSH keys only)

Run the following command to modify the SSH configuration and restart the service:

sudo sed -i 's/^#*PasswordAuthentication.*/PasswordAuthentication no/' \
  /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf && \
  sudo systemctl restart ssh
Permission denied
Step 6

Set Up Session Persistence with tmux

To ensure your coding session doesn't die when your phone locks or loses signal, use tmux (a terminal multiplexer).

apt install tmux
Install tmux
Start tmux

This starts a new session. Launch Claude Code inside it.

Claude in tmux

Now from Termius, connect to your VPS from your phone and type tmux a to attach to the most recent session.

tmux attach from phone
Connected to session
Same session on phone

Same session visible on the desktop terminal connected to the VPS:

Desktop session
Detach tmux
Step 7

Fix Scrolling (Optional)

Out of the box, tmux may not allow scrolling within the Termius app.

Enable mouse support

Copy and paste the following command in your terminal:

echo "set -g mouse on" >> ~/.tmux.conf && tmux source-file ~/.tmux.conf

Start a new named session on the VPS:

Named tmux session

Access the same session from Termius on your phone:

Attach named session
Same session on phone

And now you can scroll on your phone:

Scrolling works
Once configured, you can scroll up and down inside your tmux sessions on your phone.

Ready to Start Building with AI?

Join Vibe Coding Academy and get step-by-step tutorials, direct developer support, and everything you need to launch your first app.

Become a Founding Member

Only $97/month • Cancel anytime

Abdul Khan
Written by
Abdul Khan