đź› Step-by-Step Guide to Deploy Saleor on Google Cloud (GCE)
-
Awesome! Deploying Saleor on Google Cloud can be a great way to scale your eCommerce solution. I’ll guide you step-by-step using Google Cloud Compute Engine (GCE) or Google Kubernetes Engine (GKE) — let’s start with the simpler method: GCE with Docker + Docker Compose, which is great for development and staging.
⸻
đź› Step-by-Step Guide to Deploy Saleor on Google Cloud (GCE)
⸻
Step 1: Set Up Google Cloud Project
1. Go to Google Cloud Console
2. Create a new project or use an existing one.
3. Enable the Compute Engine API.
4. Optionally enable Cloud SQL and Cloud Storage if you plan to use managed DB or media storage.⸻
Step 2: Create a VM Instance (Compute Engine)
1. Navigate to Compute Engine > VM Instances
2. Click Create Instance
• Choose a machine type: e2-medium or better
• Boot disk: Ubuntu 22.04 LTS (or Debian)
• Allow HTTP & HTTPS traffic
3. Click CreateOnce created, SSH into the instance.
⸻
Step 3: Install Docker & Docker Compose
SSH into your instance, then run:
# Update packages sudo apt update && sudo apt upgrade -y # Install Docker sudo apt install docker.io -y sudo systemctl start docker sudo systemctl enable docker # Add user to docker group sudo usermod -aG docker $USER newgrp docker # Install Docker Compose sudo apt install docker-compose -y⸻
Step 4: Clone Saleor
git clone https://github.com/saleor/saleor-platform.git cd saleor-platformThis repo includes all components: Saleor API, Dashboard, and Storefront.
⸻
Step 5: Configure Environment Variables
Edit the .env file: cp .env.example .env nano .envUpdate:
• ALLOWED_HOSTS=your_public_ip_or_domain
• Set secrets, database URLs, etc. (You can use Docker Compose’s defaults for now)⸻
Step 6: Run with Docker Compose
docker compose build docker compose up -dIt will spin up:
• Saleor API (GraphQL)
• Dashboard (Admin Panel)
• Storefront (Next.js PWA)
• Postgres + Redis⸻
Step 7: Access Saleor
• Storefront: http://your-vm-external-ip:3000
• Dashboard: http://your-vm-external-ip:9000
• GraphQL API: http://your-vm-external-ip:8000/graphql/⸻
âś… Optional (But Recommended)
• Use Cloud SQL for a managed PostgreSQL database.
• Use Cloud Storage for static/media assets.
• Set up a domain name and HTTPS using NGINX + Let’s Encrypt or Cloud Load Balancer.
• Use GKE for production-grade, scalable deployments (I can guide you on this too).⸻
Want help with setting up HTTPS, domain, or moving to GKE? Let me know!