This project provides an easy-to-use remote development server. With this server you can work from anywhere and develop remotely on any desktop.
- Develop in a different OS: One of the most significant advantages is that it allows you to develop in the same OS as my production servers, but without using that same OS on my local PC. Or maybe you own a windows machine and want to develop in Linux.
- Same development experience from any device: You have all your code and development environment in a remote server and connect to if from different devices. You will have the same developing experience working from your home, office, or any other device. If you forgot to git push, or your work isn't ready to be committed and pushed to a remote repository, continue working on it from a different computer just by connecting to your remote development server.
- Different or better hardware: Need more RAM, CPU or GPU? Or maybe you just need a different CPU architecture AMD vs Intel.
- Run Time-Consuming Tasks: For the data scientists/machine learning. I doubt you want to train your models on your laptop. Even if it's a simple-enough model and could be done reasonably enough with a laptop dGPU, I hope you have a full battery and it can be done in an hour. Remote development servers allow you to run time-consuming tasks because the server persists even when you're not directly connected to it.
- Team work: How many times did you hear "works on my machine?" Your team can work with a machine with the same setup to ensure that everyone works with the same development environment. It is also an easy way to onboard new team members and saves time setting up the development environment.
- Projects with different requirements: Sometimes, we have to work on projects with different hardware, OS, or software version requirements. Instead of managing multiple versions of a development framework, you can have multiple remote development servers configured to each specific project need.
- Easy to maintain: Don't waste time searching in Stack Overflow or Server Fault because something got misconfigured. You can recreate your development environment and avoid wasting time with this. Treat your development machine like you treat your code.
I'm currently only supporting AWS as target hosting for the remote development server, and I use Terraform to deploy the infrastructure.
- Install and configure AWS CLI
- Install Terraform
- SSH
- Windows 10 1803+ / Server 2016/2019 1803+
- Earlier Windows
- Install Git for Windows.
- macOS
- Comes pre-installed.
- Debian/Ubuntu
- Run
sudo apt-get install openssh-client
- Run
- RHEL / Fedora / CentOS
- Run
sudo yum install openssh-clients
- Run
Optional:
VS Code with Remote Development or Remote SSH extension.
-
Configure your remote server
Open terraform.auto.tfvars and adjust the settings to your needs.
-
Deploy the infrastructure
Run
terraform init
Run
terraform apply
review what will be deployed, if you agree, typeyes
to deploy. -
Configure the remote server access
If you didn't configure the deployment with your own SSH a new key will be generated for you.
Copy the code from
-----BEGIN RSA PRIVATE KEY-----
until-----END RSA PRIVATE KEY-----
and save it in a file to be used as your private key.Connect to the server using the private key and the server IP.
Example:
ssh -i "C:\Users\Danie\.ssh\remotedev.pem" ec2-user@35.172.146.46
-
Delete the remote server
To save costs, you can delete the server when you don't need it.
By
terraform destroy
to delete all the infrastructure previously created.
-
Open VS Code Remote Explorer
-
Click to add a new SSH target
-
Type the SSH connection string to connect to the remote development server
-
Save the connection in your SSH config file.
-
Connect to the remote development server
-
Now you are able to open a terminal and folders from the remote server directly in your VS Code.
No requirements.
Name | Version |
---|---|
aws | n/a |
random | n/a |
Name | Description | Type | Default | Required |
---|---|---|---|---|
instance_type | The type of instance to start | string |
n/a | yes |
subnet_id | The VPC Subnet ID to launch in | string |
"" |
no |
Name | Description |
---|---|
key_name | Generated key name |
private-ip | EC2 private IP |
private_key_pem | SSH private pem key |
public-ip | EC2 public IP |
public_key_openssh | Open SSH public key |
public_key_pem | SSH public pem key |