-
Go to https://cloud.elastic.co
-
Sign up (14-day free trial, no credit card required)
-
Create a new deployment:
- Name: phishnchips
- Cloud Provider: AWS
- Region: us-east-1 (or closest to you)
- Version: 8.11.x
- Size: 4GB RAM, 128GB storage (default)
-
Save these credentials:
Cloud ID: phishnchips:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyQ... Username: elastic Password: <generated-password> Elasticsearch endpoint: https://xxxxx.es.us-east-1.aws.found.io:9243 Kibana endpoint: https://xxxxx.kb.us-east-1.aws.found.io:9243
Create a .env file in the project root:
# Copy the example
cp env.example .env
# Edit .env with your cloud credentials
cat > .env << 'EOF'
DEPLOYMENT_TYPE=cloud
ELASTIC_CLOUD_ID=your-cloud-id-from-step-1
ELASTIC_USER=elastic
ELASTIC_PASSWORD=your-password-from-step-1
API_PORT=8000
EOF# Install dependencies (if not already done)
pip3 install -r backend/requirements.txt python-dotenv
# Test connection
python3 scripts/test_cloud_connection.pyExpected output:
✓ Ping successful
✓ Elasticsearch version: 8.11.x
✓ Cluster status: green
✓ Number of nodes: 2
✅ All tests passed!
# Use cloud-ready setup script
python3 scripts/setup_elasticsearch.py# Load 1M records to cloud
python3 scripts/bulk_load_1m.py \
--count 1000000 \
--batch-size 2000 \
--verifyThe script automatically uses credentials from .env file.
# Start API that connects to cloud Elasticsearch
cd backend
uvicorn main_cloud_ready:app --reloadOr use Docker:
# docker-compose-cloud.yml (API only)
docker-compose -f docker-compose-cloud.yml up.env- New file with cloud credentialsbackend/main.py→ Usebackend/main_cloud_ready.pyinstead- All scripts - Automatically read from
.env
- ✓ Browser extension (just update API_ENDPOINT if deploying API to cloud)
- ✓ Data generation logic
- ✓ Index templates
- ✓ Kibana dashboards
# .env file
DEPLOYMENT_TYPE=local
ELASTICSEARCH_HOSTS=http://localhost:9200
# Start local cluster
docker-compose up -d
# Use local API
cd backend && uvicorn main:app --reload# .env file
DEPLOYMENT_TYPE=cloud
ELASTIC_CLOUD_ID=your-cloud-id
ELASTIC_USER=elastic
ELASTIC_PASSWORD=your-password
# Use cloud-ready API
cd backend && uvicorn main_cloud_ready:app --reload| Aspect | Local (Docker) | Elastic Cloud |
|---|---|---|
| Setup Time | 5 minutes | 5 minutes |
| Monthly Cost | $0 | ~$100 (can pause) |
| Maintenance | You manage | Fully managed |
| Scalability | Limited | Unlimited |
| High Availability | No | Yes (99.9% SLA) |
| Backups | Manual | Automatic |
| Best For | Dev, testing, demos | Production, demos |
💡 Tip: Use cloud for impressive demos (shows production-ready), use local for development.
| Metric | Local | Cloud |
|---|---|---|
| Network Latency | < 1ms | 20-50ms |
| Indexing Throughput | ~3000 docs/sec | ~2000 docs/sec |
| Query Latency | ~10ms | ~30-50ms |
| Data Safety | At risk | Replicated, backed up |
- ✓ Developing and testing
- ✓ Running demos without internet
- ✓ Learning distributed concepts
- ✓ Cost is a concern
- ✓ Need fast iteration
- ✓ Demonstrating production-ready system
- ✓ Need high availability
- ✓ Want to impress with scale
- ✓ Testing with remote clients
- ✓ Need automatic backups
# Check cloud deployment status at cloud.elastic.co
# Verify credentials in .env
python3 scripts/test_cloud_connection.py# Regenerate password in Elastic Cloud console
# Update .env file with new password# Check your deployment size (may need to upgrade)
# Optimize batch size: --batch-size 1000 (smaller for cloud)# Increase timeout in config_cloud.py
ES_REQUEST_TIMEOUT=60 # in .envTo migrate to cloud:
- Create Elastic Cloud account
- Create deployment (save credentials)
- Create
.envfile with cloud credentials - Test connection (
test_cloud_connection.py) - Initialize indices (
setup_elasticsearch.py) - Load data (
bulk_load_1m.py) - Start API with
main_cloud_ready.py - Test end-to-end
- Update browser extension API endpoint (if needed)
Total time: ~10-15 minutes (excluding data load time)
- Full Cloud Guide:
CLOUD_DEPLOYMENT.md - Testing Guide:
E2E_TEST_GUIDE.md - Main README:
Readme.md
- Keep Local for Dev: Use local for development, cloud for demos
- Use API Keys: More secure than password (see CLOUD_DEPLOYMENT.md)
- Monitor Costs: Pause deployment when not in use
- Optimize Batch Size: Use smaller batches (1000-2000) for cloud
- Test First: Always run
test_cloud_connection.pybefore loading data