This article walks you through the process of deploying a workspace provider to a remote VM instance using Docker.
You must have a provisioned VM with the Docker Engine installed and running. The Docker Engine must be at least version 20.10.
Coder must be able to access the VM over an SSH connection.
The Coder deployment must be accessible from the containers deployed inside the VM.
Coder uses SSH to connect to the remote VM and communicate with the Docker Engine.
We recommend that you create a new SSH key for this purpose and do not reuse this key. Furthermore, ensure that you save this key, since you'll need it to edit your workspace provider in the future.
❗ Coder does not currently support password-protected SSH keys; the SSH key must be unencrypted.
To generate your SSH key, run:
ssh-keygen -t ed25519 -C remote-c4d -f $HOME/.ssh/remote_c4d -N ""
Add your SSH key to the remote VM's
authorized_keys file; this will allow
Coder to connect via SSH using the new
Replace 'remote-us[email protected]' with your VM's user and host/ip. ssh-copy-id -f -i $HOME/.ssh/remote_c4d.pub [email protected]
Verify that you can use the key to connect via SSH to your remote VM:
Replace '[email protected]' with your VM's user and host/ip. ssh [email protected] -o IdentitiesOnly=yes -i $HOME/.ssh/remote_c4d 'echo All good!'
In your Coder for Docker deployment, ensure that you've enabled the Remote Docker Providers feature flag.
Log in to Coder, and go to Account > Feature Preview
Click to enable Remote Docker Providers
To create your workspace provider, go to Manage > Workspace providers. Click the dropdown in the top-right corner to launch Create Docker Provider
You can now fill out the provider form.
Provide a name for your new provider.
For the Docker Daemon URL, use
Under the SSH configuration section:
Under SSH Host URL, provide the SSH URL for the remote VM, including
the port (e.g.,
Copy over the private key that you created earlier (you can retrieve it
Run the keyscan provided for known host verification, and copy over the output:
Example: ssh-keyscan -p 22 -H 192.0.2.10
Optionally, set the access URL to an IP address or URL that workspaces can
use to access
coderd. You do not need this override if the site-wide
access URL is accessible from the workspace container.