Back to Blog

From Zero to Production in 60 Minutes: A Step-by-Step Guide for SaaS Startups

For SaaS startups with limited DevOps resources, deploying production-ready infrastructure remains one of the biggest hurdles to early growth. This guide shows how you can deploy a complete application stack in under an hour using Convox, with built-in security, scaling, and operational best practices.

The DevOps Dilemma for Early-Stage SaaS

If you're building a SaaS product, you've likely experienced this scenario: Your development team has created a fantastic application with market-ready features, but deploying it to production involves navigating a labyrinth of cloud infrastructure decisions.

The options typically look like this:

  • Heroku or similar platforms - Simple but expensive at scale and limited flexibility
  • Raw cloud infrastructure (AWS/GCP/Azure) - Powerful but requires specialized DevOps expertise
  • Kubernetes - The "right" way, but with a steep learning curve, requiring significant engineering resources

For startups this presents a real dilemma. You're not quite ready to hire dedicated DevOps specialists, but you need production-grade infrastructure that can scale with your business. According to the 2023 DORA (DevOps Research and Assessment) report, teams that effectively implement DevOps practices are 1.4x more likely to meet or exceed their organizational performance goals—yet smaller teams often lack the resources to implement these practices effectively.

In this guide, we'll show you how Convox bridges this gap, allowing you to deploy a complete application stack in under an hour, with all the DevOps best practices baked in.

What You'll Deploy

We'll deploy a standard three-tier application architecture:

  • A web service handling HTTP requests
  • A database for persistent storage
  • A background worker for processing tasks

This pattern accommodates most SaaS applications and demonstrates the capabilities of a complete production deployment.

Prerequisites

Before we begin, make sure you have:

  • About 60 minutes of time (actual hands-on time is less, as some steps involve waiting for processes to complete)
  • A sample application, or you can use our example Node.js app or example Rails app

Step 1: Set Up Your Convox Account and Cloud Infrastructure (15 minutes)

Unlike most platforms, Convox lets you own your infrastructure from day one. This means better security, performance, and cost control.

  1. First, create a free Convox account by signing up in the Convox Console .
  2. Next, create an Organization when prompted. Use your company or team name for better organization.
  3. Install a runtime integration for your preferred cloud provider:
    • Click on the Integrations link in the sidebar
    • Click the plus sign in the Runtime section
    • Select your cloud provider (AWS, Google Cloud, Digital Ocean, or Microsoft Azure)
    • Follow the prompts to create an integration with your cloud account
  4. Install a Rack (your dedicated infrastructure environment):
    • Navigate to the Racks tab in the web console
    • Click the cloud Install button
    • Select your newly created runtime integration
    • Choose a name for your Rack (e.g., "production")
    • Select the region closest to your users
    • Configure any specific Rack parameters as needed:
      • For AWS, you might want to set parameters like node_type or high_availability
      • For other providers, configure appropriate region or instance types

This process typically takes 10-15 minutes while Convox provisions your infrastructure. During this time, Convox is creating a Kubernetes cluster, networking configuration, security groups, load balancers, and all the components needed for a production environment.

  1. Set up the Convox CLI for command-line management:
    • Install the CLI by following the instructions for your OS
    • Obtain your CLI authentication key from the Convox Console:
      • Go to your account page
      • Copy the login command displayed
      • Run this command in your terminal to authenticate your CLI with your Convox account

Step 2: Prepare Your Application (15 minutes)

While your infrastructure provisions, let's prepare our application. Every application deployed on Convox needs two key files:

  1. Dockerfile - Defines how to build your application
  2. convox.yml - Defines how to run your application

Creating a Dockerfile

If you already have a Dockerfile, you can use it directly. If not, here's a simple example for a Node.js application:

FROM node:14-alpine

WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .

EXPOSE 3000
CMD ["node", "app.js"]

For other languages or frameworks, check out Convox's example apps or Dockerfile guide.

Creating a convox.yml

The convox.yml manifest describes the components of your application. Here's a simple example for a web service with a PostgreSQL database:

environment:
  - NODE_ENV=production
resources:
  database:
    type: postgres
    # Full database configuration options available:
    # options:
    #   version: 13
    #   storage: 100
    #   class: db.t3.large
    #   encrypted: true
    #   durable: true
services:
  web:
    build: .
    port: 3000
    resources:
      - database
  worker:
    build: .
    command: node worker.js
    resources:
      - database

This configuration includes:

  • Environment variables for all services
  • A PostgreSQL database resource (with minimal configuration shown)
  • A web service exposing port 3000
  • A background worker service running a different command
  • Both services connected to the database

Note: Convox offers extensive configuration options for resources like PostgreSQL. You can specify database version, storage capacity, instance class, encryption, high availability, and more. For AWS deployments, you can even use RDS-managed databases instead of containerized ones. See the Resource documentation for all available PostgreSQL configuration options.

Step 3: Deploy Your Application (20 minutes)

Now that your infrastructure is ready and your application is prepared, it's time to deploy:

  1. First, create an app on your rack:
convox apps create --rack=production myapp
  1. Deploy your application:
convox deploy

This process includes:

  • Packaging and uploading your source code
  • Building Docker images based on your Dockerfile
  • Creating the database resource
  • Configuring networking, load balancers, and SSL certificates
  • Starting your services with the right environment variables

Your deployment typically takes 10-20 minutes for the first build, depending on your application's size and complexity.

Step 4: Configure Your Application (10 minutes)

After your application is deployed, there are a few additional configurations to consider:

Setting Environment Variables

You can set secure environment variables for your application:

convox env set API_KEY=secret SECRET_TOKEN=token

These are encrypted at rest and injected into your application at runtime. When you set an environment variable, Convox creates a new release that needs to be promoted to take effect:

convox releases promote

Convox automatically creates and injects several important environment variables into your containers, including:

  • DATABASE_URL - A fully formed connection string for any database resource
  • PORT - The port your service should listen on
  • RACK - The name of the Rack where your app is running
  • APP - The name of your application
  • SERVICE - The name of the specific service
  • RELEASE - The current release ID

This automatic environment variable injection simplifies configuration and ensures your application has everything it needs to connect to its dependencies without manual setup.

Configure Custom Domains

By default, Convox provides a domain for your application, but you can use custom domains:

  1. In your convox.yml, add the domain to your service:
services:
  web:
    domain: ${HOST}
    ...
  1. Set the HOST environment variable:
convox env set HOST=myapp.example.org,www.myapp.example.org
  1. Configure your DNS with the Rack router endpoint:
convox rack -r production
# Look for the Router URL in the output
# Create a CNAME record from myapp.example.org to this URL

Convox will automatically provision and renew SSL certificates for your domains.

Scaling Your Application

Convox makes it easy to scale your application both manually and automatically:

Manual Scaling

To scale your service to a specific number of instances with defined resource limits:

convox scale web --count 3 --cpu 256 --memory 1024

Autoscaling Configuration

For more dynamic scaling, you can configure autoscaling in your convox.yml:

services:
  web:
    scale:
      count: 1-5  # Min-max range for autoscaling
      cpu: 256    # CPU units per process (1000 = 1 full CPU)
      memory: 512 # Memory in MB per process
      targets:
        cpu: 70   # Target CPU utilization percentage
        memory: 80 # Target memory utilization percentage

This configuration will automatically scale your service between 1 and 5 instances based on the specified CPU and memory utilization targets. When the average utilization exceeds the target, the service will scale up, and when it drops significantly below, it will scale down.

You can also configure custom metrics-based autoscaling using DataDog or other monitoring solutions for more advanced scaling triggers.

What You've Accomplished

In less than an hour, you've:

  1. Provisioned production-grade infrastructure in your own cloud account
  2. Deployed a multi-tier application with web and worker services
  3. Set up a managed database with automatic backups
  4. Configured SSL/TLS encryption and custom domains
  5. Established a foundation for easy scaling and updates

The Real Value: What Happens Behind the Scenes

What makes Convox particularly valuable for SaaS startups isn't just the quick setup, but the DevOps best practices automatically implemented:

Security

  • Network security with properly configured firewalls and security groups
  • HTTPS everywhere with automatic certificate management
  • Secrets management for environment variables
  • IAM and RBAC permissions configured according to least privilege

Scalability

  • Horizontal scaling for your services with a simple command via CLI for real-time changes:
convox scale web --count=3 --cpu=256 --memory=512
  • Automatic load balancing across instances
  • Support for autoscaling based on metrics

Operational Excellence

  • Rolling deployments with zero downtime
  • Automatic health checks and remediation
  • Centralized logging with granular service filtering:
convox logs -a myapp                # All application logs
convox logs -a myapp -s web         # Only web service logs
convox logs -a myapp -s worker      # Only worker service logs
  • Metrics and monitoring integration

Lower Total Cost of Ownership

A dedicated DevOps engineer costs $120,000+ annually in most markets. Even if they spend just 25% of their time on infrastructure management, that's $30,000 in salary alone. Convox provides the same capabilities at a fraction of the cost, allowing your development team to focus on building your product rather than managing infrastructure.

Next Steps

Now that you have a production application running, here are recommended next steps:

  1. Implement CI/CD with Convox Workflows - Using the Convox Console, navigate to the Workflows tab and set up your continuous integration and continuous delivery pipeline:
    • Create Review Workflows to automatically build and deploy preview environments for your pull requests, enabling thorough testing before merging code
    • Establish Deployment Workflows to automatically deploy verified code to staging and production environments when merged to specific branches
    • Configure pre and post-deployment hooks for tasks like database migrations or notification systems
  2. Configure comprehensive monitoring - Set up monitoring for your application to gain insights into performance, errors, and user experience. Convox integrates with various monitoring solutions and will soon offer its own integrated monitoring suite.
  3. Implement a staging environment - From the Convox Console, create a second Rack for staging by clicking the "Install Rack" button again. Use the same settings as your production Rack but with a different name (e.g., "staging"). This provides an environment to test changes before they reach production.
  4. Optimize for cost and performance - Review your service scaling configurations and resource allocations to match your actual usage patterns.

Conclusion

We've demonstrated how SaaS startups can deploy production-ready infrastructure in under an hour using Convox. This approach allows small teams to implement DevOps best practices without dedicated specialists, creating a solid foundation for growth.

As your startup scales, Convox scales with you, providing the infrastructure flexibility you need without the complexity of managing raw Kubernetes or cloud provider services.

Ready to get started? Sign up free to deploy your first application in minutes, or contact us for personalized guidance on your specific deployment needs.

Let your team focus on what matters.