lc stop

Stop all or specific LocalCloud services for the current project.

Usage

lc stop [service] [flags]

Arguments

  • service (optional) - Specific service to stop. Valid values: ai, postgres, cache, queue, minio, all

Flags

FlagShortDescriptionDefault
--all-aStop all servicestrue
--service-sStop specific service""

Examples

Stop all services

lc stop
Stops all running LocalCloud services for the current project.

Stop specific service

lc stop ai
lc stop postgres
lc stop cache

Stop using service flag

lc stop --service postgres
lc stop -s redis

Service Names

Same as lc start:
  • ai (aliases: ollama, llm)
  • postgres (aliases: db, database)
  • cache (alias: redis)
  • queue
  • minio (aliases: storage, s3)

What Happens When Stopping

  1. Service Discovery
  • Finds all running containers
  • Identifies LocalCloud services
  1. Graceful Shutdown
  • Sends SIGTERM to containers
  • Waits for clean shutdown (10s timeout)
  • Forces stop if needed
  1. Cleanup
  • Removes stopped containers
  • Preserves data volumes
  • Keeps Docker network

Output Example

Stopping LocalCloud services...

✓ Ollama stopped
✓ PostgreSQL stopped
✓ Redis stopped
✓ MinIO stopped

All services stopped successfully

Data Persistence

Data is preserved when stopping services. Your databases, models, and files remain intact.
  • AI Models: Stored in ollama_models volume
  • PostgreSQL Data: Stored in postgres_data volume
  • Redis Data: Stored in redis_data volume
  • MinIO Data: Stored in minio_data volume
To remove data, use lc reset --hard.

Error Handling

No services running

Info: No services are running
This is informational - no action needed.

Docker not running

Error: Docker is not running
Solution: Docker must be running to manage containers

Service not found

Error: service 'unknown' not found
Solution: Use valid service names (ai, postgres, cache, queue, minio)

Partial Stops

When stopping specific services, dependencies are respected:
# Stopping cache also stops queue (same Redis instance)
lc stop cache

# Other services continue running
lc status

Stop vs Reset

CommandEffectData
lc stopStops containersPreserved
lc resetStops and removes containersPreserved
lc reset --hardRemoves everythingDeleted

Advanced Usage

Force stop with timeout

# Docker will force stop after 5 seconds
docker stop -t 5 localcloud-postgres

Stop and remove containers

# Stop services and remove containers
lc stop && docker container prune -f

Troubleshooting

Service won’t stop

If a service hangs during shutdown:
  1. Check logs: lc logs [service]
  2. Force stop: docker kill localcloud-[service]
  3. Remove container: docker rm -f localcloud-[service]

Orphaned containers

# List all LocalCloud containers
docker ps -a | grep localcloud

# Remove orphaned containers
docker container prune -f