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
Flag | Short | Description | Default |
---|
--all | -a | Stop all services | true |
--service | -s | Stop specific service | "" |
Examples
Stop all services
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
- Service Discovery
- Finds all running containers
- Identifies LocalCloud services
- Graceful Shutdown
- Sends SIGTERM to containers
- Waits for clean shutdown (10s timeout)
- Forces stop if needed
- 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
Command | Effect | Data |
---|
lc stop | Stops containers | Preserved |
lc reset | Stops and removes containers | Preserved |
lc reset --hard | Removes everything | Deleted |
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:
- Check logs:
lc logs [service]
- Force stop:
docker kill localcloud-[service]
- 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