Skip to content

Quickstart

Deploy your first app to Google Cloud in 5 minutes.

Before you start, install these tools:

Terminal window
# Check your version
node --version
Terminal window
# macOS
brew install google-cloud-sdk
# Or download from: https://cloud.google.com/sdk/docs/install
Terminal window
# macOS
brew install terraform
# Or download from: https://developer.hashicorp.com/terraform/downloads
Terminal window
# Use directly with npx (recommended)
npx stacksolo --version
# Or install globally
npm install -g stacksolo
Terminal window
gcloud auth login
gcloud auth application-default login

Create a new directory and initialize StackSolo:

Terminal window
mkdir my-app
cd my-app
stacksolo init

The init command will:

  1. Ask you to select a GCP project
  2. Enable required APIs
  3. Ask what type of app you’re building
  4. Generate a config file

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" }
]
}
}]
}
}

Create a simple API function:

Terminal window
mkdir -p functions/api

Create 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!' });
});
Terminal window
stacksolo deploy

StackSolo will:

  1. Generate CDKTF/Terraform code
  2. Create a Cloud Storage bucket for your function code
  3. Deploy your Cloud Function
  4. Create a load balancer
  5. Output the URL
Terminal window
curl http://<your-load-balancer-ip>/
# {"message":"Hello from StackSolo!"}

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.

Terminal window
# See what would be deployed (dry run)
stacksolo deploy --preview
# Check deployment status
stacksolo status
# View logs
stacksolo logs
# View deploy event history
stacksolo events
# List registered projects
stacksolo list
# Destroy all resources
stacksolo destroy

Want to start with a complete, working application? Clone a pre-built stack:

Terminal window
# List available stacks
stacksolo clone --list
# Clone a stack (e.g., RAG Platform - AI chatbot with admin dashboard)
stacksolo clone rag-platform my-chatbot
cd my-chatbot
npm install
stacksolo deploy

Stacks include full source code, infrastructure config, and documentation.

If you want to add another app that shares the same VPC (to avoid GCP quota limits):

Terminal window
# Clone from your existing project
mkdir my-second-app && cd my-second-app
stacksolo clone ../my-app --name my-second-app
# Add your functions/containers to the config, then deploy
stacksolo deploy

The new project will reuse the VPC from my-app instead of creating a new one.

Make sure you’re authenticated:

Terminal window
gcloud auth login
gcloud auth application-default login

StackSolo tries to enable APIs automatically. If it fails, enable them manually:

Terminal window
gcloud services enable cloudfunctions.googleapis.com
gcloud services enable cloudbuild.googleapis.com
gcloud services enable run.googleapis.com

Install Terraform:

Terminal window
brew install terraform