Skip to main content

Web Services

Deploy backend applications with automatic scaling, load balancing, and production-ready infrastructure.

What are Web Services?

Web Services are containerized backend applications that run continuously and automatically scale based on traffic. They provide persistent HTTP endpoints for your APIs and applications.

Key Features

  • Autoscaling: Automatically scale up or down based on traffic
  • Load Balancing: Distribute traffic across multiple instances
  • Zero Downtime Deployments: Deploy updates without service interruption
  • Health Checks: Automatic health monitoring and recovery
  • Custom Domains: Use your own domain with automatic SSL certificates
  • Environment Variables: Secure configuration management
  • Logs & Metrics: Real-time observability

Use Cases

  • REST APIs and GraphQL endpoints
  • Microservices architecture
  • Webhooks and background processing
  • Long-running backend services
  • Database connections and connections pooling

Quickstart: Deploy an Express App

Deploy a Node.js Express application on Antryk in just a few clicks. This quickstart uses a simple example app, but you can use your own Express app instead.

Step 1: Fork the Repository

Fork the express-hello-world repository on GitHub.
A demo instance of this app is hosted at express-demo.antryk.com.

Example Express App Structure

The example repository contains a simple Express app:
// app.js
const express = require('express');
const app = express();
const port = process.env.PORT || 8080;

app.get('/', (req, res) => {
  res.json({ message: 'Hello from Antryk!' });
});

app.listen(port, '0.0.0.0', () => {
  console.log(`Server running on port ${port}`);
});
// package.json
{
  "name": "express-hello-world",
  "version": "1.0.0",
  "scripts": {
    "start": "node app.js"
  },
  "dependencies": {
    "express": "^4.18.2"
  }
}

Step 2: Create a Web Service

In the Antryk Dashboard, click New ServiceWeb Service and connect your repository.

Step 3: Configure Your Service

Provide the following values during creation:

Deploy from GitHub

  • Repository: Select your GitHub repository
  • Branch: Choose the branch to deploy from (e.g., main)
  • Framework: Automatically detected from your repository
  • Install Command: npm install or yarn install
  • Build Command: npm run build (if needed) or leave empty
  • Start Command: node app.js or npm start
  • Output Directory: Leave empty for Express apps
  • Version: Specify Node.js version (e.g., 18 or 20)

Region

Select your deployment region:
  • us-east-1 - Virginia, USA
  • eu-west-1 - Ireland
  • ap-south-1 - Mumbai, India
  • ap-southeast-1 - Singapore

Environment Variables

Add any environment variables your app needs (API keys, database URLs, etc.).
  • Click + Add Environment Variable to add individual variables
  • Click Add from .env to import from a .env file
  • Variables marked as Secret will be hidden in logs
Using your own app? Provide whatever commands you use to build and start it, such as npm install / npm start or bun install / bun start.

Configuration Summary

For the Express hello world app, your configuration should look like this:
SettingValue
Repositoryyour-username/express-hello-world
Branchmain
FrameworkNode.js (auto-detected)
Install Commandnpm install
Build Command(leave empty)
Start Commandnode app.js
Output Directory(leave empty)
Version18
Regionus-east-1
Make sure your Express app listens on 0.0.0.0 and uses process.env.PORT for the port. Antryk provides the port dynamically via environment variables.

Step 4: Deploy

Click Deploy and your web service will be live at its antryk.app URL as soon as the deploy finishes.
Going forward, every push to your linked branch automatically builds and deploys your app. If a build fails, Antryk cancels the deploy, and your app’s existing version continues running until the next successful deploy.

Step 5: Monitor Your Deployment

Once deployed, you can:
  • View Logs: Real-time logs from your application
  • Check Metrics: CPU, memory, and request metrics
  • View Deployments: History of all deployments
  • Manage Scaling: Add or remove instances
  • Update Config: Modify environment variables and settings

Troubleshooting Express Apps

App won’t start:
  • Check the Start Command matches your package.json scripts
  • Ensure your app listens on 0.0.0.0 and uses process.env.PORT
  • Review build logs for errors
Environment variables not working:
  • Verify variables are set in the console
  • Restart the service after adding variables
  • Check variable names match your code
Build failing:
  • Check Node.js version compatibility
  • Review package.json dependencies
  • Ensure build commands are correct
Database connection issues:
  • Verify database credentials in environment variables
  • Check database is accessible from service IP
  • Review connection pooling settings

Getting Started

  1. Create a new Web Service from your dashboard
  2. Connect your repository or use Docker images
  3. Configure resources (CPU, memory, instances)
  4. Set environment variables and secrets
  5. Deploy and get your service URL

Console Configuration

When creating a Web Service in the Antryk console, you’ll configure these settings:

Deploy from GitHub

  1. Repository: Select the GitHub repository you want to deploy
  2. Branch: Choose the branch to deploy from (e.g., main, develop)
  3. Framework: Automatically detected from your repository
  4. Install Command: Command to install dependencies (e.g., npm install, yarn install, pip install -r requirements.txt)
  5. Build Command: Command to build your project (e.g., npm run build, yarn build)
  6. Start Command: Command to start your app (e.g., npm start, node app.js, python app.py)
  7. Output Directory: Where your built files are stored (leave empty for Express APIs)
  8. Version: Runtime version (e.g., Node.js 18, Python 3.11)

Region

Pick a region — resources will be provisioned here:
  • us-east-1 - Virginia, USA
  • us-west-2 - Oregon, USA
  • eu-west-1 - Ireland
  • eu-central-1 - Frankfurt, Germany
  • ap-south-1 - Mumbai, India
  • ap-southeast-1 - Singapore
  • ap-northeast-1 - Tokyo, Japan

Environment Variables

Set environment-specific config and secrets (API keys, tokens, etc.). These values will be available to your app at runtime.
  • Add individual variables or import from .env file
  • Mark variables as secret to hide them in logs
  • Use different values for different environments

Configuration Examples

Node.js/Express

Install Command: npm install
Build Command: npm run build
Start Command: npm start
Version: 18

Python/Flask

Install Command: pip install -r requirements.txt
Build Command: (leave empty)
Start Command: gunicorn app:app
Version: 3.11

Python/FastAPI

Install Command: pip install -r requirements.txt
Build Command: (leave empty)
Start Command: uvicorn app:app --host 0.0.0.0 --port 8080
Version: 3.11

Go

Install Command: go mod download
Build Command: go build -o app
Start Command: ./app
Version: latest

Ruby/Rails

Install Command: bundle install
Build Command: rails assets:precompile
Start Command: bundle exec rails server -b 0.0.0.0 -p 8080
Version: 3.2

Advanced Configuration

Web Services support additional configuration through:
  • Docker: Use custom Docker images
  • Autoscaling: Set min/max instances based on CPU or memory
  • Health Checks: Configure custom health check endpoints
  • Resources: Adjust CPU and memory allocation
  • Instance Type: Choose between standard and performance instances

Pricing

Web Services are billed by:
  • Instance hours: Running time of your service
  • Resource usage: CPU and memory allocation
  • Bandwidth: Inbound and outbound data transfer

Deploy Your First Web Service

Get started with web services