Areas we serve

Self-Hosted AnyCable: WebSockets Without Killing Your Rails Worker

Rails Action Cable is brilliant until five hundred browsers hang off the same Puma worker and your deploy restarts everyone mid–stand-up. You could blame the users. You could also move WebSockets somewhere built to hold connections.

AnyCable (anycable/anycable) splits realtime from your app server: a fast WebSocket front end (the Go anycable-go binary) talks to your Ruby, Laravel, Python, or Node backend over RPC, while broadcasts ride Redis or NATS. MIT licensed, about 2,400 GitHub stars, docs at docs.anycable.io. It speaks the same protocol as Action Cable, so the stock JavaScript client still works—no front-end hostage situation.

What you are actually self-hosting

Think three moving parts on your infrastructure:

  • anycable-go — holds WebSocket connections, origin checks, headers forwarding.
  • RPC server — your framework’s AnyCable gem/package handling auth, channel logic, subscriptions.
  • Broadcast adapter — Redis (typical in production) or HTTP for lighter setups so Rails can shout “new message” and Go can fan it out.

Rails shops run anycable-rails, flip adapter: any_cable in cable.yml, add anycable-go beside rails s in the Procfile, and keep channel code where it always lived. Laravel, Django, FastAPI, and “plain HTTP pub/sub” paths exist too—the docs are organized by language now, not only Ruby.

Why self-host AnyCable?

Live dashboards, order status tickers, support chat, multiplayer-ish features—the payloads are often business data. Running WebSockets on a Canadian VPS with your Redis instance keeps connection metadata and broadcast traffic off a random SaaS realtime tier. You still might use hosted plus.anycable.io for convenience; self-hosting is for teams that already deploy Sidekiq, Postgres, and want another horizontal box, not another vendor.

Performance is the other honest reason: Go chews through idle sockets while Ruby processes stay free for HTTP and jobs. Evil Martians built this because production Action Cable hurt at scale; the architecture shows.

Deployment sketch

Production means TLS in front of anycable-go, shared secrets (secret, broadcast_key) between app and WS server, and Redis on localhost or a private network. Match dev and prod RPC modes—if production uses gRPC, do not fake it in dev with HTTP only and pray on Friday deploys.

This belongs on a cloud VPS or dedicated node with process supervision (systemd, Kamal, Kubernetes, whatever you already run). Not cPanel: long-lived WebSockets and custom binaries do not play nice with shared PHP hosts.

Good fit / skip it

Good fit: Rails/Laravel/Python apps already on Action Cable or Reverb-shaped patterns, agencies shipping client portals with live updates, teams comfortable running Redis + multiple processes.

Skip it: static brochure sites, apps with zero realtime requirements, orgs that will not run Redis or a second daemon, greenfield JS that only needs Socket.io on one Node box.

Bottom line

AnyCable is self-hosted realtime infrastructure—Go WebSockets, framework RPC, Redis broadcasts—without ditching Action Cable clients. Put it on your VPS, free your app server from holding ten thousand idle tabs, and keep live features on infrastructure you control.

Talk with Swift Host about Canadian VPS hosting for multi-process stacks—we are in St. Albert, and we have seen Puma suffer so you do not have to.

Tags:
  • AnyCable
  • WebSockets
  • Rails
  • Go
  • Self-Hosted

Need Help With Your Hosting?

Tell us about your application — we respond within 1 hour with honest recommendations.