Connect
You reach a machine in two ways, and both go through the gateway: SSH, and HTTPS to a URL you give one of its ports. This page covers SSH, and how to reach any other port over it. Public URLs covers HTTPS. A machine also has a public IPv6 address of its own, which takes connections directly on any port: IPv6.
Open a shell
$ ssh calm-river-otter@ssh.arvm.dev
The part before @ is the machine. The gateway at ssh.arvm.dev checks your SSH key, finds the machine, and signs you in as the user dev. The CLI runs the same command for you. It also starts the machine if it is stopped, and adds this computer’s SSH public key to your org if it is not there yet:
$ arvm ssh calm-river-otter
The command is the same after every stop and start. Each machine also returns it in its ssh field:
$ curl -s "https://api.arvm.dev/v1/machines/calm-river-otter" \
-H "Authorization: Bearer $ARVM_API_KEY"
The gateway’s host key
Each machine’s ssh_host_key field is the key the gateway proves itself with. The CLI writes it to a known_hosts file of its own, so arvm ssh, arvm cp and the entries of arvm ssh-config check the gateway on the first connection, with no question to answer. A server that does not hold that key is refused before your SSH key is offered to it, and ssh says REMOTE HOST IDENTIFICATION HAS CHANGED. Your own ~/.ssh/known_hosts is not read or written.
To check the key with plain ssh and no CLI, add it to your known_hosts before you connect:
$ echo "ssh.arvm.dev $(curl -s "https://api.arvm.dev/v1/machines/calm-river-otter" \
-H "Authorization: Bearer $ARVM_API_KEY" | jq -r .ssh_host_key)" >> ~/.ssh/known_hosts
Add an SSH key
The gateway accepts any SSH key of your org, for every machine of your org. arvm ssh, arvm cp and arvm ssh-config --install add this computer’s key by themselves. arvm ssh-keys add adds another: it takes the public key’s file, and --name for what to call it. List the keys:
$ arvm ssh-keys ls
arvm ssh-keys rm removes a key by its ID. The same through the API:
$ curl -s -X POST "https://api.arvm.dev/v1/ssh-keys" \
-H "Authorization: Bearer $ARVM_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"name\": \"$(hostname)\", \"public_key\": \"$(cat ~/.ssh/id_ed25519.pub)\"}"
List the keys:
$ curl -s "https://api.arvm.dev/v1/ssh-keys" \
-H "Authorization: Bearer $ARVM_API_KEY"
Remove a key by its ID. The key stops working through the gateway at once, and arvm removes it from the machines it was installed in.
$ curl -s -X DELETE "https://api.arvm.dev/v1/ssh-keys/sshkey_01jcz3k8x0e5v9w2r4t6y8a0bq" \
-H "Authorization: Bearer $ARVM_API_KEY"
How the gateway finds your machine
The name before @ is one of three things:
| You write | Example | Unique |
|---|---|---|
| The machine’s name | calm-river-otter |
In your org |
| The machine’s DNS label | calm-river-otter-x7k2 |
Everywhere |
| The machine’s ID | m_01jcz3k8x0e5v9w2r4t6y8a0bq |
Everywhere |
The gateway looks only at machines of the orgs that hold the key you present. If exactly one machine matches, you are signed in. If none matches, or more than one, the gateway refuses. When several machines match, its message names the DNS label of each. Use the DNS label then:
$ ssh calm-river-otter-x7k2@ssh.arvm.dev
A machine’s dns_label is in its API response. It never changes, even when you rename the machine.
Set up your SSH config
The CLI writes an entry for each of your machines, so that ssh calm-river-otter, scp, rsync and an editor’s remote mode reach the machine with no arvm command in between:
$ arvm ssh-config --install
The entries go into a file of the CLI’s own, and ~/.ssh/config gets one Include line for it. arvm new, arvm rename and arvm rm keep the file up to date. Each entry checks the gateway’s host key.
Or write an entry yourself. This one makes ssh otter open the machine:
Host otter
HostName ssh.arvm.dev
User calm-river-otter
The entry stays valid across stops and starts, because the machine’s address is its name at the gateway and not an IP address.
Use an editor, copy files, forward a port
The gateway carries standard SSH, so tools built on SSH work with the config entry above.
- VS Code and Cursor. Install the Remote - SSH extension, run Remote-SSH: Connect to Host, and pick
otter. - JetBrains. Use Remote Development with the SSH host
otter.
Copy a file to the machine and back:
$ scp ./app.tar.gz otter:/home/dev/
$ scp otter:/home/dev/build.log .
Forward the machine’s port 8080 to your computer’s port 8080. This is how you reach a port that is not HTTP, such as a database: the port is open to your computer only, and to nobody on the internet.
$ ssh -L 8080:localhost:8080 otter
The CLI does the same for a machine by its name, until you press Ctrl-C:
$ arvm forward calm-river-otter 8080
Run one command and exit:
$ ssh otter uname -r
IPv6
Each machine has a public IPv6 address of its own, in its ipv6 field. The machine’s connections out over IPv6 come from it. While the machine’s inbound is open, anyone on the internet can also connect to it there: TCP and UDP on every port, and ping.
$ arvm get calm-river-otter
name calm-river-otter
...
ipv6 2001:db8:1:2:0:1:0:7
inbound open
A new machine’s inbound is open. A machine has no public IPv4 address of its own.
| Direction | IPv4 | IPv6 |
|---|---|---|
| Outbound, from the machine | Yes, through an address shared with other machines on the server | Yes, from the machine’s own address |
| Inbound, to the machine | Only through the gateway: SSH and endpoint URLs | Directly, on every port, while inbound is open |
What reaches a machine:
| You want | Use |
|---|---|
| A shell, a file copy, an editor | SSH through the gateway: Open a shell |
| An HTTP server on a port | An endpoint URL: Public URLs |
| Any TCP port, from your own computer only | An SSH port forward: ssh -L or arvm forward |
| A TCP port that is not HTTP, or a UDP port, open to the internet | The machine’s IPv6 address, with inbound open |
Serve a port on the address
Start something that listens on IPv6, and connect to the address from a computer that has IPv6:
dev@calm-river-otter:~$ python3 -m http.server 9000 --bind ::
$ curl "http://[2001:db8:1:2:0:1:0:7]:9000/"
- Only IPv6. A client on a network with no IPv6 cannot reach the address. For such clients, use an endpoint URL or an SSH port forward, which work over IPv4.
- No name. arvm gives the address no DNS name. Point an
AAAArecord of your own domain at it if you need one. - No TLS. A connection to the address reaches your program as the client sent it. The gateway’s certificate covers endpoint URLs only.
- The address stays. It is the same after a stop and a start, a restart and a resize, for as long as the machine exists. A machine created from a snapshot is a new machine with a new address.
- A stopped machine does not answer, and a connection does not start it. A connection to the address also does not count as activity for idle stop, because it does not pass the gateway. A machine that serves a port this way needs idle stop turned off:
arvm new --idle-timeout never. - SSH works there too.
ssh dev@2001:db8:1:2:0:1:0:7signs you in with an SSH key that the machine was created with (ssh_key_ids), without the gateway.sshdtakes no password.
What is open on a new machine
With inbound open, the platform passes TCP, UDP and ping to every port of the address, and puts no port filter in the way. It drops other IP protocols, and new connections past the limit on how many can be open to one machine. What answers is what listens in the machine:
- A new machine listens on one port:
sshdon TCP port 22, which accepts SSH keys only. Password login and root login are off. - The machine answers ping.
- The image has no firewall of its own. Everything you start that listens on
::or0.0.0.0is reachable from the internet on its port. Bind to127.0.0.1what you do not mean to publish, or install a firewall in the machine (sudo apt install ufw). Allow port 22 before you enable it:arvm sshand endpoint URLs reach the machine’s ports from the server, through the same firewall. - Docker publishes to the internet.
docker run -p 5432:5432listens on every address of the machine, the public one included. Write-p 127.0.0.1:5432:5432for a port that only the machine itself should reach. A port bound that way cannot have an endpoint URL either. For a port that needs a URL and no direct connections, closeinbound.
Close the address
$ arvm inbound calm-river-otter closed
$ arvm new --inbound closed
The same through the API:
$ curl -s -X PATCH "https://api.arvm.dev/v1/machines/calm-river-otter" \
-H "Authorization: Bearer $ARVM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"inbound": "closed"}'
In the dashboard it is Inbound from the internet, in a machine’s settings and in the form that creates one.
With inbound closed, the server drops every new connection to the address before it reaches the machine, and the machine does not answer a ping. Outbound connections and their replies work as before, and so do arvm ssh, the terminal, exec, files and endpoint URLs, none of which use the address.
- The change takes effect within seconds. The machine is not restarted.
- An open address takes TCP, UDP and ping. Other IP protocols, such as SCTP or GRE, do not reach the machine.
- Connections that are open when you close the address stay open until they end.
- Another machine, yours or another customer’s, reaches an open address as anyone on the internet does. Nothing reaches a machine’s private IPv4 address from outside it, whatever the setting.
- The number of connections open to one machine at a time is limited, as the number it opens is.
Outbound connections
A machine can open connections to the internet over IPv4 and IPv6, with these limits:
- TCP port 25 is blocked. A machine cannot send mail directly.
- A machine cannot reach another customer’s machine, or the server it runs on, over a private address.
- Bandwidth is not billed. Each machine has a bandwidth limit and a limit on open connections.
Terminal in the browser
The dashboard has a terminal for each running machine. It opens a shell as dev over a WebSocket, with no SSH key needed. The machines reference describes the protocol for programs.
When SSH fails
- No machine matches. The key you present is not in your org, or no machine of your org has that name. Add the key, and check the name against a list of your machines.
- Several machines match. The gateway’s message names the DNS label of each. Use the DNS label.
- The machine is not running. Start it, then connect again. The gateway does not start a stopped machine.