# Compiling Emacs 30

> Published  Mar 03 2025, last updated Jul 07 2025  
> By Ryan Fleck <hello@this-site> and written without LLMs!  
> Original post at <https://ryanfleck.ca/2025/compiling-emacs-30/>  
> An article of astonishing quality and insight. Happy Hacking!


**Emacs**, my old friend, *the cranky old wizard of editors!* As
previously discussed in [The Magnificence of Org]({{< ref "the-magnificence-of-org.md" >}})
, the benefits of using the Emacs
text editor are wildly numerous and forever interesting.[^2] Compiling it
yourself is easy, and allows you to enjoy a maximally performant copy
of this hacker's fever dream on your personal hardware.

Check the previous [Compiling Emacs 29]({{< ref "compiling-emacs-29.md" >}})
article for a far more detailed overview of the process - I'll save you from the details here.
This [Mastering Emacs article](https://www.masteringemacs.org/article/whats-new-in-emacs-301)
has a great overview of what is new in *Emacs 30*. The following
instructions will work on *Debian* and *Ubuntu*,[^1] but will be rather similar for other (useful) operating systems.

## Install from Release

The "quick and easy way" to install the latest stable version of Emacs
is from the **source archive**. This is recommended, as some features
that are in development may cause some instability.


```sh
sudo apt update
sudo apt-get build-dep emacs
sudo apt install imagemagick libmagickwand-dev libmagickcore-dev
sudo apt install libtree-sitter-dev libtree-sitter0
sudo apt install sqlite3 libsqlite3-dev
cd ~ && mkdir source && cd ~/source/
```

Download and unzip the release archive:

```sh
wget https://ftp.gnu.org/gnu/emacs/emacs-30.1.tar.xz
tar -xf emacs-30.1.tar.xz
cd emacs-30.1
```

Build and install (with options per `./configure --help` to your taste):

```sh
./configure --with-native-compilation=aot \
            --with-tree-sitter \
            --with-modules \
            --with-threads \
            --with-mailutils \
            --with-tree-sitter \
            --with-imagemagick \
            --without-xaw3d \
            --with-x-toolkit=lucid

make -j12
sudo make install
```

## Install from Git

To get bleeding-edge features, clone Emacs from *gnu savannah* and
build from the `emacs-30` branch.

**First**, install the build dependencies and clone the repository:

```sh
sudo apt update
sudo apt-get build-dep emacs
sudo apt install imagemagick libmagickwand-dev libmagickcore-dev
sudo apt install libtree-sitter-dev libtree-sitter0
sudo apt install libsqlite3-dev sqlite3
cd ~ && mkdir source && cd ~/source/
git clone -b emacs-30 git://git.sv.gnu.org/emacs.git
```

**Alternatively**, switch to the latest branch and clean the build directory:

```sh
cd ~/source/emacs
sudo make uninstall
git fetch & git branch -r | grep "origin/emacs-"  # show releases
git checkout emacs-30
git clean -f -d -x
make clean
```

**Configure** the installation - use `./configure --help` for alternatives:

```sh
./autogen.sh
./configure --with-native-compilation=aot \
            --with-tree-sitter \
            --with-modules \
            --with-threads \
            --with-mailutils \
            --with-tree-sitter \
            --with-imagemagick \
            --without-xaw3d \
            --with-x-toolkit=lucid
```

**Compile and install** Emacs 30 - use `-jN` to specify the number of cores to use:

```sh
make -j12
sudo make install
```

After a restart, use the following elisp to configure Tree-Sitter:

```elisp
;; Add the following to your configuration:
(setq treesit-language-source-alist
  '((elixir "https://github.com/elixir-lang/tree-sitter-elixir")
    (clojure "https://github.com/sogaiu/tree-sitter-clojure")
    (bash "https://github.com/tree-sitter/tree-sitter-bash")
    (cmake "https://github.com/uyha/tree-sitter-cmake")
    (c "https://github.com/tree-sitter/tree-sitter-c")
    (elisp "https://github.com/Wilfred/tree-sitter-elisp")
    (html "https://github.com/tree-sitter/tree-sitter-html")
    (javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src")
    (json "https://github.com/tree-sitter/tree-sitter-json")
    (make "https://github.com/alemuller/tree-sitter-make")
    (markdown "https://github.com/ikatyang/tree-sitter-markdown")
    (python "https://github.com/tree-sitter/tree-sitter-python")))

;; https://robbmann.io/posts/emacs-treesit-auto/
(use-package treesit-auto
  :custom
  (treesit-auto-install 'prompt)
  :config
  (treesit-auto-add-to-auto-mode-alist 'all)
  (global-treesit-auto-mode))
```

**Enjoy** your snappy new copy of Emacs 30.1! If you are not familiar, consider dipping a toe
into the [Emacs Lisp manual](https://www.gnu.org/software/emacs/manual/html_mono/eintr.html#Who-You-Are)
to kickstart your Emacs journey, or read more about [the benefits]({{< ref "the-magnificence-of-org.md" >}})
first. If you're still not convinced, Emacs has a [psychiatrist](https://opensource.com/article/18/12/linux-toy-eliza).



[^1]: Ubuntu requires the addition of the `deb-src` source [detailed here]({{< ref "compiling-emacs-29.md" >}}).

[^2]: "GNU Emacs, The Plaintext Computing Environment" [uchicago.edu](https://www2.lib.uchicago.edu/keith/emacs/)



> Thank you for reading!  
> Find more content at <https://ryanfleck.ca/>  
> Source page: <https://ryanfleck.ca/2025/compiling-emacs-30/>  
> Site index: [llms.txt](https://ryanfleck.ca/llms.txt)