SSH into Cloudflare Containers, now with zero setup!
Hey there, it's me, Shii-chan! Today I've got a nice little update for anyone tinkering with Cloudflare Containers.
Cloudflare ChangelogWhat was announced?
Over on the Cloudflare Changelog, they announced that SSH into Containers through Wrangler is now enabled by default. The setting you used to flip on yourself now works right out of the box.
The story so far
Before this, you had to set ssh.enabled to true in your Container configuration before you could connect. Just wanting to peek inside meant one extra step every time.
What changes
Now you only need to register a public key, and you can hop in with wrangler containers ssh right away. And the security stays just as tight. No public ports are exposed, and connections are authenticated against your Cloudflare account, so nobody gets to wander in uninvited.
Dive Deep
To connect, first add an ssh-ed25519 public key to your Container configuration as an authorized_keys entry.
{
"containers": [
{
"authorized_keys": [
{
"name": "my-key",
"public_key": "YOUR_PUBLIC_KEY_HERE"
}
]
}
]
}
Then just run wrangler containers ssh INSTANCE_ID and you're in! If you haven't registered a key, connections won't go through even with SSH enabled, so nothing is left wide open by accident. And every connection goes only through wrangler containers ssh, which keeps things safe.
If you'd rather turn SSH off, set ssh.enabled to false in your configuration.
{
"containers": [
{
"ssh": {
"enabled": false
}
}
]
}
Want the full picture? Check out the SSH documentation.
Wrap-up
- SSH into Cloudflare Containers through Wrangler is now enabled by default
- Register a public key in
authorized_keysand connect instantly withwrangler containers ssh - No public ports are exposed, and connections authenticate against your Cloudflare account
- Don't need it? Turn it off by setting
ssh.enabledtofalse
This one's perfect for anyone running apps on Containers who wants to pop inside now and then to check on things!