---
title: "Deploy Floci — GCP Emulator"
description: "A fast, open-source GCP emulator for development and testing."
category: "Other"
url: https://railway.com/deploy/floci-gcp
---

# Deploy Floci — GCP Emulator

A fast, open-source GCP emulator for development and testing.

**[Deploy Floci — GCP Emulator on Railway](https://railway.com/template/floci-gcp)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/floci-gcp/manifest.json

- **Creator:** INF Labs
- **Category:** Other

## Template content

### floci https://res.cloudinary.com/drxplgxxg/image/upload/v1788763915/floci.png

- **Image:** floci/floci-gcp:latest
- **Public domain:** Yes

## Documentation

# Deploy and Host Floci GCP Emulator on Railway

Floci GCP is a fast, free, and open-source Google Cloud Platform emulator for development, testing, automation, and CI/CD workflows.

It provides GCP-compatible REST and gRPC APIs through a single endpoint, allowing applications to use services such as Cloud Storage, Pub/Sub, Firestore, Datastore, Secret Manager, IAM, KMS, Cloud Tasks, Cloud Scheduler, BigQuery, Cloud Run, Cloud SQL, GKE, and more without requiring a real Google Cloud account.

## About Hosting Floci GCP

This template deploys Floci GCP on Railway using the official `floci/floci-gcp:latest` Docker image.

All supported GCP REST and gRPC services share a unified endpoint on port `4588`. Applications, Google Cloud SDKs, development environments, Terraform, OpenTofu, and automated test suites can connect to the Railway deployment instead of real GCP endpoints.

Persistent emulator state is stored in a Railway volume mounted at `/app/data`.

Some advanced Floci GCP services normally start Docker sidecars, including Cloud Run, Cloud SQL, Managed Kafka, and GKE. Railway does not expose the host Docker socket, so this template configures those services to use their mock implementations instead.

## Common Use Cases

* Develop applications against GCP-compatible APIs without a Google Cloud account
* Test Cloud Storage, Pub/Sub, Firestore, Datastore, Secret Manager, and other GCP services
* Run integration and end-to-end tests against isolated GCP-like infrastructure
* Test Google Cloud SDK integrations
* Use Terraform or OpenTofu against emulated GCP APIs
* Build CI/CD environments without consuming real GCP resources
* Test middleware and automation workflows that integrate with GCP
* Provide a shared remote GCP emulator for development teams

## Dependencies for Floci GCP Hosting

* Official `floci/floci-gcp:latest` Docker image
* Railway public networking on port `4588`
* Railway persistent volume mounted at `/app/data`

## How to Use Floci GCP

After deployment, Railway provides a public domain similar to:

```text
https://your-floci-gcp.up.railway.app
```

Use this Railway domain as your GCP emulator endpoint.

For the examples below:

```bash
export FLOCI_GCP_ENDPOINT="https://your-floci-gcp.up.railway.app"
export GOOGLE_CLOUD_PROJECT="floci-local"
```

Replace the example URL with your actual Railway public domain.

## 1. Check Floci GCP Health

Verify that the emulator is running:

```bash
curl "$FLOCI_GCP_ENDPOINT/_floci-gcp/health"
```

The Floci GCP control plane is available under:

```text
/_floci-gcp
```

## 2. Configure GCP Emulator Variables

Google Cloud SDK libraries support standard emulator environment variables.

Point them to your Railway deployment:

```bash
export GOOGLE_CLOUD_PROJECT="floci-local"

export PUBSUB_EMULATOR_HOST="your-floci-gcp.up.railway.app:443"
export FIRESTORE_EMULATOR_HOST="your-floci-gcp.up.railway.app:443"
export DATASTORE_EMULATOR_HOST="your-floci-gcp.up.railway.app:443"
export SECRET_MANAGER_EMULATOR_HOST="your-floci-gcp.up.railway.app:443"

export STORAGE_EMULATOR_HOST="https://your-floci-gcp.up.railway.app"
```

Floci does not require a real Google Cloud account or real production credentials for normal emulator usage.

## 3. Cloud Storage Example

Using Python and `google-cloud-storage`:

```python
import os
from google.cloud import storage

os.environ["STORAGE_EMULATOR_HOST"] = (
    "https://your-floci-gcp.up.railway.app"
)

client = storage.Client(project="floci-local")

bucket = client.bucket("my-bucket")
client.create_bucket(bucket)

blob = bucket.blob("hello.txt")
blob.upload_from_string("Hello from Floci GCP on Railway")

print(blob.download_as_text())
```

This creates the bucket and object inside Floci instead of real Google Cloud Storage.

## 4. Pub/Sub Example

Configure the emulator:

```bash
export PUBSUB_EMULATOR_HOST="your-floci-gcp.up.railway.app:443"
export GOOGLE_CLOUD_PROJECT="floci-local"
```

Using Python:

```python
import os

os.environ["PUBSUB_EMULATOR_HOST"] = (
    "your-floci-gcp.up.railway.app:443"
)

from google.cloud import pubsub_v1

publisher = pubsub_v1.PublisherClient()

topic_path = publisher.topic_path(
    "floci-local",
    "events"
)

publisher.create_topic(
    request={"name": topic_path}
)

future = publisher.publish(
    topic_path,
    b"hello from floci-gcp"
)

future.result()
```

## 5. Firestore Example

Configure Firestore:

```bash
export FIRESTORE_EMULATOR_HOST="your-floci-gcp.up.railway.app:443"
export GOOGLE_CLOUD_PROJECT="floci-local"
```

Using Python:

```python
import os

os.environ["FIRESTORE_EMULATOR_HOST"] = (
    "your-floci-gcp.up.railway.app:443"
)

from google.cloud import firestore

db = firestore.Client(
    project="floci-local"
)

db.collection("users").document("1").set({
    "name": "Floci User",
    "environment": "Railway"
})

document = (
    db.collection("users")
    .document("1")
    .get()
)

print(document.to_dict())
```

## Supported GCP Services

Floci GCP provides emulation for a broad range of Google Cloud APIs, including:

* Cloud Storage
* Pub/Sub
* Firestore
* Datastore
* Secret Manager
* Cloud KMS
* IAM
* IAM Service Account Credentials
* STS
* OAuth
* Firebase Authentication
* Cloud Logging
* Cloud Monitoring
* Cloud Tasks
* Cloud Scheduler
* Eventarc
* BigQuery
* Cloud Functions
* Cloud Run
* Cloud SQL
* Managed Kafka
* Google Kubernetes Engine
* Resource Manager
* Service Usage

Service coverage and implementation completeness may vary between releases.

## Docker-Backed Services on Railway

Some Floci GCP services can normally start additional Docker containers.

These include:

| Service       | Normal Floci Backend     | Railway Template |
| ------------- | ------------------------ | ---------------- |
| Cloud Run     | Docker container         | Mock mode        |
| Cloud SQL     | PostgreSQL/MySQL sidecar | Mock mode        |
| Managed Kafka | Redpanda sidecar         | Mock mode        |
| GKE           | k3s sidecar              | Mock mode        |

Railway does not expose:

```text
/var/run/docker.sock
```

Therefore this template uses:

```env
FLOCI_GCP_SERVICES_KAFKA_MOCK="true"
FLOCI_GCP_SERVICES_CLOUDSQL_MOCK="true"
FLOCI_GCP_SERVICES_CLOUDRUN_MOCK="true"
FLOCI_GCP_SERVICES_GKE_MOCK="true"
```

This allows control-plane and API-level emulation without requiring Docker sidecars.

## Persistent Storage

This template uses:

```env
FLOCI_GCP_STORAGE_MODE="persistent"
FLOCI_GCP_STORAGE_PERSISTENT_PATH="/app/data"
```

with a Railway volume mounted at:

```text
/app/data
```

In `persistent` mode, writes are persisted directly to disk.

Floci GCP also supports other storage modes such as:

| Mode         | Behavior                               |
| ------------ | -------------------------------------- |
| `memory`     | State exists only in memory            |
| `persistent` | Writes are synchronously persisted     |
| `hybrid`     | Memory-first with periodic disk flush  |
| `wal`        | Write-ahead log for maximum durability |

This Railway template uses `persistent` to provide predictable state retention across restarts.

Deleting the Railway volume will also delete the persisted emulator state.

## Floci GCP vs Official GCP Emulators

| Feature                            | Floci GCP | Official GCP Emulators |
| ---------------------------------- | --------- | ---------------------- |
| Single unified port                | ✅         | ❌                      |
| REST + gRPC                        | ✅         | ✅                      |
| Cloud Storage                      | ✅         | Limited                |
| Pub/Sub                            | ✅         | ✅                      |
| Firestore                          | ✅         | ✅                      |
| Datastore                          | ✅         | ✅                      |
| Secret Manager                     | ✅         | ❌                      |
| Cloud KMS                          | ✅         | ❌                      |
| IAM                                | ✅         | ❌                      |
| Cloud Tasks                        | ✅         | ❌                      |
| Cloud Scheduler                    | ✅         | ❌                      |
| Cloud Run APIs                     | ✅         | ❌                      |
| Cloud SQL APIs                     | ✅         | ❌                      |
| Managed Kafka APIs                 | ✅         | ❌                      |
| GKE APIs                           | ✅         | ❌                      |
| Multiple services in one container | ✅         | ❌                      |
| Requires Google Cloud account      | ❌         | ❌                      |

Google's official emulators are generally deployed as separate service-specific processes, while Floci GCP provides multiple GCP-compatible services through a single endpoint.

## Why Deploy Floci GCP on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

Deploying Floci GCP on Railway provides a remotely accessible GCP-compatible development environment with automatic HTTPS, persistent storage, unified REST and gRPC endpoints, and simple infrastructure management without maintaining your own server.

## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/floci-gcp
