What is Coder?
Coder is an open-source cloud development environment (CDE) that you host in your cloud or on-premises. With Coder, you can deploy environments that provide the infrastructure, IDEs, and tools your developers need.
What is VS Code?
Visual Studio Code, commonly referred to as VS Code, is an integrated development environment (IDE) developed by Microsoft for Windows, Linux, macOS and web browsers.
Pre-requisites
Before we discuss how to install Coder on AlmaLinux VPS and connect Workspace to VS Code, be sure you have the following:
- AlmaLinux VPS Server (AlmaLinux 8/AlmaLinux 9)
- Familiarity with the Linux command-line.
Install Coder on AlmaLinux VPS and Connect Workspace to VS Code
To install Coder on AlmaLinux VPS and connect workspace to VS Code, follow the steps below:
Install and Start Coder
- Login to your VPS via SSH.
- Update the server packages:
sudo dnf update -y
- Install Docker:
sudo dnf install -y yum-utils device-mapper-persistent-data lvm2 dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo curl -sSL https://get.docker.com | sh sudo dnf install -y docker-ce docker-ce-cli containerd.io sudo systemctl start docker sudo systemctl enable docker
For more details, visit:
- Assign your user to the Docker group:
sudo usermod -aG docker $USER
- Run
newgrp
to activate the groups changes:newgrp docker
You might need to log out and back in or restart the machine for changes to take effect.
- Install Coder:
curl -L https://coder.com/install.sh | sh
- For standalone binaries, system packages, or other alternate installation methods, refer to the latest release on GitHub.
- Start Coder:
coder server
Configure Coder with a New Workspace
- Locate the message in your terminal that reads,
View the Web UI: https://<CUSTOM-STRING>.<TUNNEL>.try.coder.app
. The server begins to stream logs immediately and you might have to scroll up to find it.
- Access the URL in your browser.
- On the Welcome to Coder page, enter the information to create an admin user, then select Create account.
- On the Workspaces page, select Go to templates to create a new template.
- For this guide, use a Docker container. Locate Docker Containers and select Use template.
- Give the template a Name that you’ll recognize both in the Coder UI and in command-line calls. The rest of the template details are optional, but will be helpful when you have more templates.
- Select Create template.
- After the template is ready, select Create Workspace.
- Give the workspace a name and select Create Workspace.
- Coder starts your new workspace:
- Select VS Code Desktop to install the Coder extension and connect to your Coder workspace.
Using VS Code
After VS Code loads the remote environment, you can select Open Folder to explore directories in the Docker container or work on something new.
To clone an existing repository:
- Select Clone Repository and enter the repository URL.
For example, to clone the Coder repo, enterhttps://github.com/coder/coder.git
.
Learn more about how to find the repository URL in the GitHub documentation. - Choose the folder to which VS Code should clone the repo. It will be in its own directory within this folder.
Note that you cannot create a new parent directory in this step. - After VS Code completes the clone, select Open to open the directory.
- You are now using VS Code in your Coder environment!
Conclusion
You now know how to install Coder on AlmaLinux VPS and connect workspace to VS Code.