LinuxmacOS

Where Does Spacemacs Store Config and Layers?

Where Spacemacs keeps its .spacemacs config file, private layers, cache folders, and session state.

Last updated

Spacemacs splits its files three ways: your config in ~/.spacemacs, the framework in ~/.emacs.d, and generated caches in ~/.emacs.d/.cache. Layers declare themselves in the config and materialize in the cache.

That split decides upgrades and backups. Version the .spacemacs file; treat emacs.d as disposable output rebuilt on sync. Private layers bridge the two, living in your config tree while loading like framework code. Cache wipes fix most post update breakage. Order layers deliberately.

Where Spacemacs stores this, by platform

Linux
~/.spacemacs

.spacemacs (or .spacemacs.d/init.el) plus private/ layers here. Newer builds honor ~/.config/spacemacs as an alternative root. The SPC f e D shortcut opens this file from inside the editor.

macOS
~/.spacemacs

Same .spacemacs layout via Homebrew or manual installs. The emacs.d tree behaves identically across Unixes. Native compilation cache in .cache/nativecomp can grow large and clears safely.

Frequently asked questions

where is the spacemacs config file

In ~/.spacemacs (or ~/.spacemacs.d/init.el) with dotspacemacs-layers and dotspacemacs-configuration-layers listing layers. Newer installs accept ~/.config/spacemacs. Edit the file then restart or dotspacemacs/sync-configuration for changes.

where do spacemacs private layers go

In ~/.emacs.d/private/ or a directory you declare in the layers list. Private layers keep custom packages and keybinds out of the framework tree. The framework updates overwrite everything except private and .spacemacs.

where is the spacemacs cache

In ~/.emacs.d/.cache/ (quelpa builds, elpa mirrors, undo history). Delete it with Emacs closed to force clean rebuilds; config in .spacemacs survives untouched. Persistent bookmarks and histories live outside the cache, so they survive wipes.

Notice an outdated path? Let us know.