I am running Cursor by connecting via a docker container, however after ending the session I am losing my Cursor chats. I am looking for a way to keep the chats and workspaces persistent even after a session is closed and the container is stopped.
Hey, thanks for the report. Losing chat history when you stop a Docker container is expected behavior, since the data is stored inside the container and gets removed with it.
Cursor chat history is stored in workspaceStorage (the state.vscdb files). To keep history between sessions:
Use a Docker volume to persist Cursor data:
Mount ~/.cursor-server from the container to the host
Example: -v cursor-data:/home/user/.cursor-server
If you’re using a devcontainer, add this to devcontainer.json:
I can see you’re using “Attach to Container” (based on nameConfigs). In that case, Cursor server data is stored inside the container and gets deleted with it.
To make chat history persistent:
Add a volume for cursor-server data when starting the container: docker run -v cursor-server-data:/home/jovyan/.cursor-server ...
If you want to use devcontainer.json instead of attach, add a mount:
Make sure remoteUser in the config matches the user inside the container (in your case, jovyan).
Quick check: do you create a new container each time, or reuse the same one? If the container gets recreated, a volume is required to keep the history.
Chats are stored by the container name and workspace path – specifically the workspace uri – on your client device (not inside the container). Are you able to deterministically control the container name so it is consistent across sessions?
I don’t think so, whenever this container is launched the number associated with it changes, I am able to re-open the chats if I close cursor without stopping the container though.