Service · API

Deploy an API.

An API on HostingGuru is a long-running HTTP service: a process that listens on a port, gets traffic routed to it, and survives across requests. This is the right service type for any backend that handles HTTP requests — REST, GraphQL, gRPC-Web, tRPC, anything that doesn't need to fall back to serverless functions.

How it works

From GitHub to a live URL in four steps

A single-click deploy interaction

1. Connect GitHub

Install the HostingGuru GitHub App on the organization or personal account that owns the repository. The App grants read access to repositories you pick — no broad repo token, no SSH keys to manage. Webhooks for pushes are registered automatically.

2. Create the service

From the dashboard, click New service → API. Pick the repo, the branch (defaults to main), and the root directory if your API lives in a monorepo subfolder. We auto-detect the framework — Express, Fastify, NestJS, FastAPI, Django, Flask, Gin, Echo, Rails, Spring Boot, Laravel — and pre-fill the build and start commands. Override anything you don't like.

3. Add environment variables

Paste your .env file or add variables one by one. Each variable is encrypted at rest with AES-256-GCM and injected into your process at runtime — never written to disk on the runner. Mark a variable as secret to redact it from logs and the dashboard preview.

4. Deploy

Click Deploy. We clone the repo, run the build command, start your process, run a TCP health check on the configured port (default $PORT), and only route traffic once it's responding. You get a public URL like your-service.app.hostingguru.io, HTTPS, and HTTP/2 immediately.

What you get

An API service is more than a process

Service management dashboard preview

Auto-deploy on every push

Every push to the configured branch triggers a build and deploy. Auto-deploy is included on Hobby, Pro, and Custom plans.

Free SSL + custom domain

Attach api.yourcompany.com by adding a DNS record. We verify ownership, request a Let's Encrypt certificate, and rotate it automatically. Custom domains are included on Hobby, Pro, and Custom. Starter only serves on the wildcard subdomain.

Zero-downtime restarts

New deploys start the new process, wait for it to pass the health check, then drain connections from the old one before stopping it. Long-running requests, websockets, and SSE streams are flushed cleanly — no 502s during deploy.

Logs & metrics

Every line your process writes to stdout/stderr is captured and streamed to the dashboard in real time. Filter by level, search by substring, follow live.

Instant rollback

Every successful deploy is kept as a build artifact. One click rolls you back to any prior version — same image, same env vars at the time, no rebuild. Rollbacks complete in seconds.

Connect to managed Postgres & Redis

The Databases and Redis tabs in the dashboard give you connection strings — paste them into your service's environment variables (typically DATABASE_URL and REDIS_URL). Both use SSL/TLS by default, and they're independent from your services so you can share them across an API, a worker, and a script.

Framework detection

What we look for in your repo

If we find one of these, we configure the build and start commands for you. Override anything from the dashboard.

Plan limits

Resources per API service

FAQ

Common questions

How does HostingGuru know which port my API listens on?

We inject a PORT environment variable. Bind to that — most frameworks already do process.env.PORT || 3000 by default. If your code is hard-coded to a specific port, set it as an environment variable in the dashboard or change the code to read PORT.

Can I run a websocket server?

Yes. Long-lived connections are first-class — your API is a real Node/Python/Go process, not a Lambda. Socket.IO, native ws, SSE, and gRPC-Web all work. Connections are drained gracefully on deploy.

How do I run database migrations on deploy?

Two options. Option 1 — add a release command (npx prisma migrate deploy, rails db:migrate, alembic upgrade head) that runs after build and before start. Option 2 — use an on-demand script triggered manually or on a cron, which keeps deploy time fast and lets you run migrations independently. See on-demand scripts.

What happens if my process crashes?

The container restarts automatically with exponential backoff. After 5 consecutive crashes inside 5 minutes, the service is marked failed and we stop restarting until you push a fix or rollback. The crash logs are kept in the dashboard.

Can I attach a Postgres database?

Yes — managed Postgres is a top-level Databases tab in the dashboard. Pick a plan, create a database, copy the connection string, paste it into your API's env vars as DATABASE_URL. See databases.

Does the free tier sleep?

No. The Starter plan gives you one always-on service with shared resources. There is no idle timeout, no cold start. It's the same runtime as the paid plans, just with smaller limits.

Deploy your first API in under 5 minutes.

Push your repo, pick a branch, hit deploy. No credit card needed.

Summary

Key takeaways

An HTTP API on HostingGuru is a long-running web service that accepts requests on a HostingGuru-issued HTTPS endpoint or your custom domain. Frameworks like Express, FastAPI, Rails, Gin, and Axum are auto-detected.

  • Zero-downtime deploys: 30-second drain window before the old version exits.
  • Free SSL: Let's Encrypt cert provisioned in under 60 seconds for custom domains.
  • Health checks: automatic restart and rollback on consecutive failures.
  • No platform-level request cap on paid plans — apply your framework's rate-limit middleware instead.

How does HostingGuru route traffic to my API?

Incoming requests hit a regional edge load balancer (Frankfurt or Ashburn) and are routed directly to your container over the private network. No CDN sits between the client and your API, so server-sent events and long polling work without buffering.

Can I run a public API with strict latency requirements on HostingGuru?

Yes. On Pro and above, your API runs on a dedicated CX22 server (4 vCPU, 8 GB RAM) with no noisy-neighbor risk. p99 latency in our internal benchmark of a small Express API is under 25 ms in-region.

Related docs