Quickstart
Deploy your first app to Google Cloud in 5 minutes.
Prerequisites
Section titled “Prerequisites”Before you start, install these tools:
1. Node.js 18+
Section titled “1. Node.js 18+”# Check your versionnode --version2. Google Cloud CLI
Section titled “2. Google Cloud CLI”# macOSbrew install google-cloud-sdk
# Or download from: https://cloud.google.com/sdk/docs/install3. Terraform
Section titled “3. Terraform”# macOSbrew install terraform
# Or download from: https://developer.hashicorp.com/terraform/downloadsStep 1: Install StackSolo
Section titled “Step 1: Install StackSolo”# Use directly with npx (recommended)npx stacksolo --version
# Or install globallynpm install -g stacksoloStep 2: Login to Google Cloud
Section titled “Step 2: Login to Google Cloud”gcloud auth logingcloud auth application-default loginStep 3: Initialize a Project
Section titled “Step 3: Initialize a Project”Create a new directory and initialize StackSolo:
mkdir my-appcd my-appstacksolo initThe init command will:
- Ask you to select a GCP project
- Enable required APIs
- Ask what type of app you’re building
- Generate a config file
Step 4: Look at Your Config
Section titled “Step 4: Look at Your Config”After init, you’ll have a .stacksolo/stacksolo.config.json file:
{ "project": { "name": "my-app", "gcpProjectId": "your-gcp-project", "region": "us-central1", "backend": "cdktf",
"networks": [{ "name": "main", "functions": [{ "name": "api", "runtime": "nodejs20", "entryPoint": "api", "allowUnauthenticated": true }], "loadBalancer": { "name": "gateway", "routes": [ { "path": "/*", "backend": "api" } ] } }] }}Step 5: Create Your Function
Section titled “Step 5: Create Your Function”Create a simple API function:
mkdir -p functions/apiCreate functions/api/package.json:
{ "name": "api", "main": "index.js", "dependencies": { "@google-cloud/functions-framework": "^3.0.0" }}Create functions/api/index.js:
const functions = require('@google-cloud/functions-framework');
functions.http('api', (req, res) => { res.json({ message: 'Hello from StackSolo!' });});Step 6: Deploy
Section titled “Step 6: Deploy”stacksolo deployStackSolo will:
- Generate CDKTF/Terraform code
- Create a Cloud Storage bucket for your function code
- Deploy your Cloud Function
- Create a load balancer
- Output the URL
Step 7: Test Your API
Section titled “Step 7: Test Your API”curl http://<your-load-balancer-ip>/# {"message":"Hello from StackSolo!"}What Just Happened?
Section titled “What Just Happened?”StackSolo created these GCP resources:
- A Cloud Storage bucket (for function source code)
- A Cloud Function (Gen2)
- A serverless NEG (Network Endpoint Group)
- A backend service
- A URL map
- An HTTP proxy
- A global IP address
- A forwarding rule
All from a 20-line config file.
Common Commands
Section titled “Common Commands”# See what would be deployed (dry run)stacksolo deploy --preview
# Check deployment statusstacksolo status
# View logsstacksolo logs
# View deploy event historystacksolo events
# List registered projectsstacksolo list
# Destroy all resourcesstacksolo destroyStarting from a Stack
Section titled “Starting from a Stack”Want to start with a complete, working application? Clone a pre-built stack:
# List available stacksstacksolo clone --list
# Clone a stack (e.g., RAG Platform - AI chatbot with admin dashboard)stacksolo clone rag-platform my-chatbotcd my-chatbotnpm installstacksolo deployStacks include full source code, infrastructure config, and documentation.
Adding Another Project
Section titled “Adding Another Project”If you want to add another app that shares the same VPC (to avoid GCP quota limits):
# Clone from your existing projectmkdir my-second-app && cd my-second-appstacksolo clone ../my-app --name my-second-app
# Add your functions/containers to the config, then deploystacksolo deployThe new project will reuse the VPC from my-app instead of creating a new one.
Troubleshooting
Section titled “Troubleshooting””Permission denied” errors
Section titled “”Permission denied” errors”Make sure you’re authenticated:
gcloud auth logingcloud auth application-default login“API not enabled” errors
Section titled ““API not enabled” errors”StackSolo tries to enable APIs automatically. If it fails, enable them manually:
gcloud services enable cloudfunctions.googleapis.comgcloud services enable cloudbuild.googleapis.comgcloud services enable run.googleapis.com“Terraform not found”
Section titled ““Terraform not found””Install Terraform:
brew install terraformNext Steps
Section titled “Next Steps”- Configuration Guide - Learn all config options
- Local Development - Run locally with Kubernetes
- Resource Sharing - Share VPCs, buckets, and registries
- CLI Reference - All commands explained