Running Theia (VSCode-like IDE) in the Cloud & Sharing it Securely
Do you want a VSCode-like IDE running in your Linux cloud server accessible from anywhere? In this post, I’ll walk you through:
- Installing and building Theia
- Securely forwarding your IDE through SSH using
push-pull-portshell scripts.
Let’s go!
On Your Cloud Server
Prerequisites
Make sure you have the latest stable Node.js, git, and python3.
For Linux:
Install the required development tools and libraries (Ubuntu/Debian, for other distros, see the Theia docs):
1 | |
Globally install corepack (for yarn and pnpm):
1 | |
Cloning and Building Theia
Clone the repo and install dependencies:
1 | |
Building Theia is memory-intensive (~4GB RAM required).
To check your current max heap size (MB):
1 | |
If less than 4000, temporarily boost Node.js heap:
1 | |
Now build:
1 | |
Then download plugins:
1 | |
Running Theia
Start Theia (recommended to use tmux for a persistent session):
1 | |
By default, it starts at http://localhost:3000/.
On Your Local Machine
Secure Remote Access
Open-sourcing a dev server is risky. Instead, securely tunnel access to your local machine using push-pull-port—dead-simple shell scripts to “push” or “pull” TCP ports via SSH.
Benefits:
- No port forwarding rules
- No VPN
- Auto-reconnecting
- Jargon-free
Prerequisites
autossh (for robust tunnels):
- Ubuntu
1
sudo apt install autossh - macOS
1
brew install autossh
- Ubuntu
SSH keys set up for passwordless login to your cloud server.
Generate an SSH keypair (if not yet):
1
2ssh-keygen
ssh-copy-id [-p <ssh_port>] <user>@<host>
Pull Theia Cloud Port to Your Local Machine
To “pull” remote port 3000 to your local port 13000:
1 | |
- Now, visit http://localhost:13000 in your browser—it connects right to your private cloud Theia instance, securely, via SSH.
Tip: You can specify a custom SSH port with -p.