Last updated: January 15, 2024

Quick Start Guide

This guide will help you deploy your first application to UnlimitBytes in under 5 minutes.

Prerequisites

Before you begin, make sure you have:

  • A UnlimitBytes account (Sign up for free)
  • Node.js 16+ or Docker installed
  • Your application code ready
  • Git installed on your machine

Step 1: Install the CLI

The UnlimitBytes CLI is the easiest way to deploy and manage your applications.

npm install -g @unlimitbytes/cli

Using yarn

yarn global add @unlimitbytes/cli

Using Docker

docker pull unlimitbytes/cli
alias ub='docker run -it --rm -v $(pwd):/app unlimitbytes/cli'

Verify the installation:

ub --version
# Output: @unlimitbytes/cli v2.1.0

Step 2: Login to Your Account

Authenticate with your UnlimitBytes account:

ub login

This will open your browser to complete the authentication. Alternatively, you can use an API token:

ub login --token YOUR_API_TOKEN

You can generate an API token from your Account Settings.

Step 3: Create a New Project

Option A: Deploy from Existing Code

Navigate to your project directory and initialize:

cd your-project
ub init

The CLI will detect your application type and generate a unlimitbytes.yaml configuration file.

Option B: Use a Template

Start with one of our pre-built templates:

# List available templates
ub templates:list

# Create from template
ub create my-app --template nodejs-express
cd my-app

Available templates:

  • nodejs-express - Express.js API server
  • nodejs-nextjs - Next.js application
  • python-flask - Flask web application
  • python-django - Django application
  • go-gin - Gin web framework
  • static-site - Static HTML/CSS/JS website

Step 4: Configure Your Application

Edit the generated unlimitbytes.yaml file:

app:
  name: my-first-app
  region: us-east-1
  runtime: nodejs18

build:
  dockerfile: Dockerfile
  
resources:
  cpu: 500m
  memory: 512Mi
  
env:
  NODE_ENV: production
  PORT: 3000
  
network:
  ports:
    - name: http
      port: 3000
  ingress:
    enabled: true
    domain: my-first-app.unlimitbytes.app

Key configurations:

  • name: Your application name (must be unique)
  • region: Deployment region (us-east-1, eu-west-1, ap-southeast-1, etc.)
  • runtime: Application runtime environment
  • resources: CPU and memory allocation
  • network: Port and domain configuration

Step 5: Deploy Your Application

Deploy with a single command:

ub deploy

You’ll see real-time deployment progress:

⏳ Building Docker image...
✓ Image built successfully (2m 15s)

⏳ Pushing to registry...
✓ Image pushed (45s)

⏳ Deploying to production...
✓ Deployment created
✓ Health check passed
✓ Application is live!

🚀 Your application is now running at:
   https://my-first-app.unlimitbytes.app

📊 View dashboard: https://app.unlimitbytes.com/apps/my-first-app
📝 View logs: ub logs --follow

Verify Your Deployment

Check Application Status

ub status

Output:

Application: my-first-app
Status: Running
Region: us-east-1
Instances: 2/2 running
URL: https://my-first-app.unlimitbytes.app
Last Deployed: 2 minutes ago

View Logs

# Follow real-time logs
ub logs --follow

# View last 100 lines
ub logs --tail 100

# Search logs
ub logs --search "error"

Test Your Application

curl https://my-first-app.unlimitbytes.app

Next Steps

Congratulations! 🎉 You’ve successfully deployed your first application to UnlimitBytes.

Add a Database

# Create a PostgreSQL database
ub database:create my-db --type postgres --version 15

# Get connection string
ub database:info my-db

# Add to environment variables
ub env:set DATABASE_URL=$(ub database:info my-db --format url)

Set Up Custom Domain

# Add custom domain
ub domain:add www.myapp.com

# Configure DNS (follow instructions)
ub domain:verify www.myapp.com

# Enable SSL
ub ssl:create www.myapp.com --auto

Configure Auto-Scaling

# Edit unlimitbytes.yaml
cat >> unlimitbytes.yaml << EOF
autoscaling:
  enabled: true
  min_replicas: 2
  max_replicas: 10
  target_cpu: 70
EOF

# Apply changes
ub deploy

Set Up CI/CD

Create .github/workflows/deploy.yml:

name: Deploy to UnlimitBytes

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      
      - name: Deploy
        env:
          UB_API_TOKEN: ${{ secrets.UB_API_TOKEN }}
        run: |
          npm install -g @unlimitbytes/cli
          ub login --token $UB_API_TOKEN
          ub deploy --wait

Common Tasks

Update Your Application

# Make changes to your code
git commit -am "Update feature"

# Deploy changes
ub deploy

Scale Your Application

# Scale to 5 instances
ub scale --replicas 5

# Auto-scale based on CPU
ub autoscale --min 2 --max 10 --target-cpu 70

Manage Environment Variables

# Set environment variable
ub env:set API_KEY=secret123

# List all variables
ub env:list

# Remove variable
ub env:unset API_KEY

Rollback Deployment

# View deployment history
ub deployments:list

# Rollback to previous version
ub rollback

# Rollback to specific version
ub rollback --version v1.2.3

Troubleshooting

Deployment Failed

# Check deployment logs
ub logs --deployment latest

# View events
ub events

# Validate configuration
ub config:validate

Application Not Responding

# Check health status
ub health

# View instance logs
ub instances:list
ub logs --instance pod-abc123

# Restart application
ub restart

Build Errors

# View build logs
ub builds:logs latest

# Test build locally
docker build -t my-app .
docker run -p 3000:3000 my-app

Getting Help

Learn More

Happy deploying! 🚀