Cloud Run for Beginners: Deploy a Container or Website in Minutes
Google Cloud Run for beginners: services vs jobs, deploying from source with gcloud, scaling and concurrency, pricing, free tier, secrets, and access control.
Last checked against Google's official documentation on .

Google Cloud Run is the easiest way to run your own code on Google Cloud. You do not create servers, patch operating systems, or size a cluster. You hand it a container, or just your source code, and it gives you an HTTPS URL that scales from zero to thousands of requests and back again.
For an IT team, that makes it the natural home for small internal tools: a Slack or Chat bot, a webhook that updates a sheet, a dashboard for the help desk, or a script that used to run on someone’s desktop. This guide walks through the concepts, a first deployment, the settings that matter, and how to keep it secure with your Google Workspace identities.
Key Takeaways
- Cloud Run runs containers without servers and scales to zero.
- Services answer requests; jobs run to completion.
gcloud run deploy --source .builds and deploys without a Dockerfile.- Default concurrency is 80 requests per instance; tune it before adding instances.
- Keep services private by default and use IAP for staff tools.
Table of contents
Open Table of contents
- Services, Jobs, and Functions
- Your First Deployment
- Settings That Matter
- Secrets and Configuration
- Access Control
- Scheduling a Job
- Custom Domains
- Pricing and the Free Tier
- Logs and Monitoring
- Troubleshooting Deployments
- Revisions and Rollbacks
- Reaching Private Resources
- IT Tools That Fit Cloud Run Well
- Conclusion
Services, Jobs, and Functions

| Type | What it is | Good for |
|---|---|---|
| Service | Runs your container behind an HTTPS URL | Web apps, APIs, webhooks, bots |
| Job | Runs tasks to completion, on demand or on a schedule | Reports, imports, clean-ups |
| Function | A single function deployed on Cloud Run | Small event handlers |
| Worker pool | Always-on background workers without a URL | Queue consumers |
Cloud Run functions are what used to be Cloud Functions; they now run on Cloud Run under the hood. For most IT tools, a service or a job is all you need.
Your First Deployment
You need a project with billing, the gcloud CLI (or Cloud Shell, which has it installed), and some code. Here is a tiny Python web app:
# main.py
from flask import Flask
app = Flask("helpdesk")
@app.get("/")
def hello():
return "Hello from Cloud Run"
# requirements.txt
flask
gunicorn
With gunicorn in the requirements, Google’s Python buildpack starts the app with Gunicorn on the port Cloud Run provides, so no extra start command is needed for this example.
Deploy it from the folder:
gcloud run deploy helpdesk-hello \
--source . \
--region asia-south1 \
--no-allow-unauthenticated
Cloud Build packages the code into a container with buildpacks, stores it in Artifact Registry, and deploys a new revision. A few minutes later you get a URL ending in run.app.
Because we used --no-allow-unauthenticated, only principals with the Cloud Run Invoker role can call it. That is the right default for anything internal.
Settings That Matter
Concurrency. Each instance handles up to 80 requests at once by default; the maximum is 1,000. Raise it for lightweight I/O-bound apps, lower it to 1 for code that is not thread-safe.
Minimum and maximum instances. With a minimum of zero, you pay nothing when idle but the first request after a quiet period has a cold start. Set a minimum of one for user-facing tools where a two-second delay annoys people. Set a sensible maximum to cap cost if traffic spikes.
CPU and memory. Start with the defaults and increase only if logs show the app is constrained. Google’s quotas list up to 8 vCPU and 32 GiB of memory per instance.
Request timeout. The default is shorter than the maximum of 60 minutes. Long-running work belongs in a job, not a service.
Billing mode. Request-based billing charges only while requests are being handled. Instance-based billing charges for the whole lifetime of instances and suits apps that do background work between requests.
Secrets and Configuration
Never put passwords or API keys in code or plain environment variables. Store them in Secret Manager and mount them:
gcloud run deploy helpdesk-hello \
--source . --region asia-south1 \
--set-secrets=API_TOKEN=helpdesk-api-token:latest
Give the service its own service account with access to just that secret and the resources it uses. Our service accounts guide explains why the default compute account is a poor choice.
Access Control
You have three common patterns:
- Private, called by other services. Grant Cloud Run Invoker to a calling service account. Good for webhooks between internal systems.
- Private, used by staff in a browser. Enable Identity-Aware Proxy on the service, then grant IAP-secured Web App User to a Workspace group. See our IAP guide.
- Public. Allow unauthenticated access, for example for a public website. If your organization enforces Domain Restricted Sharing, you will need a project-level exception for
allUsers.
Network ingress settings
IAM decides who may call a service; ingress settings decide which networks can reach it at all, and Google recommends using both. There are three:
| Setting | gcloud value | Who can reach the service |
|---|---|---|
| Internal | internal | Internal Application Load Balancers, VPC networks in the same project and certain Google Cloud products. Not the internet |
| Internal and Cloud Load Balancing | internal-and-cloud-load-balancing | Everything Internal allows, plus the external Application Load Balancer. Direct internet requests to run.app are blocked |
| All | all | Everything, including the internet straight to the run.app URL |
Set it with gcloud run services update SERVICE --ingress internal. If a load balancer fronts the service, you can also turn off the run.app URL with --no-default-url. Admins can limit which settings teams may choose with the run.allowedIngress organization policy.
Scheduling a Job
For a nightly task, create a job and trigger it with Cloud Scheduler:
gcloud run jobs deploy nightly-report \
--source . --region asia-south1 \
--tasks 1 --max-retries 1
gcloud scheduler jobs create http nightly-report-trigger \
--location asia-south1 --schedule "0 2 * * *" --time-zone "Asia/Kolkata" \
--uri "https://run.googleapis.com/v2/projects/PROJECT_ID/locations/asia-south1/jobs/nightly-report:run" \
--http-method POST \
--oauth-service-account-email scheduler@PROJECT_ID.iam.gserviceaccount.com
Custom Domains
The run.app URL is fine for internal tools behind IAP. For a branded domain, the most flexible option is a global external Application Load Balancer with a serverless network endpoint group pointing at the service. It adds cost but supports managed certificates, Cloud Armor, and multiple regions. Firebase Hosting is a simpler option for public websites.
Pricing and the Free Tier
Cloud Run’s free tier covers 2 million requests, 180,000 vCPU-seconds, and 360,000 GiB-seconds a month with request-based billing. Many internal tools never leave it. Costs to watch are minimum instances (which run all the time), Artifact Registry storage for old images, and outbound data. A budget on the project, as in our billing guide, catches surprises.
Logs and Monitoring
Everything your app writes to standard output appears in Cloud Logging, and the Cloud Run page shows request counts, latency, and errors. Set an alert on the 5xx error rate for any tool people rely on.
Troubleshooting Deployments
“The user-provided container failed to start and listen on the port defined by the PORT environment variable.” The app is listening on a fixed port or on localhost. Listen on 0.0.0.0 and the port in PORT, which defaults to 8080. Check the revision’s logs for a crash during start-up.
“Permission denied” during a source deploy. The account running the build needs permission to use Cloud Build and push to Artifact Registry, and the build service account needs access to the source bucket. Granting the deployer the Cloud Run Source Developer role, where available, or the documented set of roles fixes most cases.
Callers get 403 Forbidden. The service does not allow unauthenticated access and the caller lacks Cloud Run Invoker. Grant the role, or for browser users put IAP in front.
The first request is slow. That is a cold start. Set minimum instances to one, keep the container small, and avoid heavy work at start-up.
Costs rise with no traffic. Minimum instances or instance-based billing keep instances running. Check both settings on each revision.
Revisions and Rollbacks
Every deployment creates a new revision, and Cloud Run keeps the old ones. That makes rollbacks easy:
gcloud run services update-traffic helpdesk-hello \
--to-revisions=helpdesk-hello-00004-xyz=100 --region asia-south1
You can also split traffic, for example sending 10% to a new revision to test it with real users before moving everyone. For internal tools, a simple rule works well: deploy with no traffic to the new revision, open its tagged URL to test, then move traffic across.
Reaching Private Resources
Many internal tools need to talk to a database or VM with a private IP. Cloud Run can send traffic into your VPC with Direct VPC egress, which places the service’s outbound traffic in a subnet you choose, or with a Serverless VPC Access connector in older setups. Direct VPC egress is the simpler option for new services.
gcloud run deploy helpdesk-hello --source . --region asia-south1 \
--network=prod-vpc --subnet=run-subnet --vpc-egress=private-ranges-only
With private-ranges-only, traffic to private IP ranges goes through the VPC while internet traffic leaves directly. Combine it with firewall rules that allow the subnet to reach only the database port. Our VPC networking guide covers the firewall side.
IT Tools That Fit Cloud Run Well
| Tool | Type | Trigger |
|---|---|---|
| Google Chat bot for help desk FAQs | Service | Chat events |
| Webhook that logs form submissions to a sheet | Service | HTTP |
| Nightly report from Workspace usage data in BigQuery | Job | Cloud Scheduler |
| Internal dashboard for license counts | Service behind IAP | Browser |
| Clean-up of old files in a bucket | Job | Cloud Scheduler |
Each of these is a few hundred lines of code at most, and none of them needs a server running all day.
Conclusion
Cloud Run removes almost all the infrastructure work from running small apps. Deploy from source, keep the service private, give it its own service account, and put IAP in front of anything staff use. It is the fastest way for an IT team to move scripts off laptops and into something reliable.
Pair it with the identities you already manage in Google Workspace, and access control becomes group membership. Tomorrow’s guide covers Cloud Storage classes, lifecycle rules, and costs.
Official Google documentation:
- What is Cloud Run
- Deploy services from source code
- Cloud Run quotas and limits
- Restrict network ingress for Cloud Run
Related reading:
- Identity-Aware Proxy Guide: staff sign-in for Cloud Run tools.
- Google Cloud Free Tier and Free Trial: what Cloud Run usage is free.
- Agent Runtime: Deploy and Scale AI Agents: when an agent needs a managed runtime instead.
This guide contains referral or affiliate links. If you sign up through one, Workspace Blog may earn a commission at no extra cost to you. Read our referral and advertising disclosure.
Frequently Asked Questions
- What is Cloud Run?
- Cloud Run is Google Cloud's serverless platform for containers. You give it a container image or source code, and it runs your app, scales it with traffic (including down to zero), and gives it an HTTPS URL. You do not manage servers or clusters.
- What is the difference between a Cloud Run service and a job?
- A service responds to HTTP requests or events and stays available at a URL. A job runs tasks to completion and then stops, which suits batch work such as nightly reports or data clean-up. Google's quotas page lists a maximum of 60 minutes per request for services and up to 7 days per task for jobs.
- Do I need Docker to use Cloud Run?
- No. The command gcloud run deploy --source builds a container for you using Cloud Build and Google's buildpacks, for common languages such as Python, Node.js, Go, and Java. You only need a Dockerfile if you want full control of the image.
- Is Cloud Run free?
- Cloud Run has a monthly free tier of 2 million requests, 180,000 vCPU-seconds, and 360,000 GiB-seconds of memory for request-based billing. Small internal tools often stay inside it, especially because services scale to zero when idle.
- How do I make a Cloud Run service private?
- Do not allow unauthenticated invocations. Grant the Cloud Run Invoker role only to the users, groups, or service accounts that should call it, or enable Identity-Aware Proxy on the service so staff sign in with their Google Workspace accounts.