diff --git a/lxd/daemon.go b/lxd/daemon.go
index <HASH>..<HASH> 100644
--- a/lxd/daemon.go
+++ b/lxd/daemon.go
@@ -1510,6 +1510,10 @@ func (d *Daemon) Stop(ctx context.Context, sig os.Signal) error {
 			if err != nil {
 				logger.Warn("Failed loading instances from disk", log.Ctx{"err": err})
 			}
+
+			// Make all future queries fail fast as DB is not available.
+			d.gateway.Kill()
+			d.cluster.Close()
 		}
 	}
lxd/daemon: Close global database after query failure in Stop