For some workflows, especially those centered around the terminal, it makes sense to run Emacs as a server so that you can use emacsclient
to quickly pop up an Emacs frame. I mostly just have a GUI instance of Emacs running all the time but it’s convenient when I’m in a terminal—especially on a remote machine—to pop up an Emacs frame right in the terminal rather than switching focus to the GUI Emacs. M. J. Wall has a script that makes that easy.
A GUI Emacs instance is started automatically when my desktop comes up so I initiate the server from my init.el
. Other people have different processes and maybe don’t even have a desktop so it’s convenient to be able to start the Emacs server early on so that emacsclient
is available whenever it’s needed.
Happily, the Emacs Wiki has us covered with an article on how to run Emacs as a daemon. The idea is that Emacs is started at boot time but as server. The article covers how to do this on various Linux systems and on OS X. It also covers how to shut down the server and how to run separate servers for multiple users. If you want to run Emacs as a daemon, be sure to give this article a read.