If you're using Emacs 24 and haven't configured MELPA yet, you're missing out on thousands of community-maintained packages. MELPA (Milkypostman's Emacs Lisp Package Archive) is the largest and most active Emacs package repository, offering bleeding-edge packages that are updated daily from their source repositories.
What is MELPA?
Emacs 24 introduced package.el, a built-in package manager that revolutionized how Emacs users install and manage extensions. By default, Emacs only knows about the official GNU ELPA repository, which contains a relatively small collection of packages that meet strict GNU criteria.
MELPA changes this by providing:
- Thousands of packages – Community-maintained extensions covering every imaginable use case
- Daily updates – Packages are built directly from source repositories, so you get the latest features
- Easy installation – One-command installation via
M-x package-install - Automatic dependency management – Packages automatically install their dependencies
The Problem
The official GNU ELPA repository is conservative by design. Many popular Emacs packages aren't available there because:
- They don't meet GNU's copyright assignment requirements
- They're too experimental or bleeding-edge
- Authors prefer faster release cycles
- They're hosted on GitHub rather than GNU infrastructure
This leaves Emacs users manually downloading .el files, managing load paths, and tracking updates themselves—exactly what package managers are meant to solve.
The Solution: Multiple Package Repositories
You can configure Emacs to check multiple package repositories, giving you access to both stable GNU packages and the vibrant MELPA ecosystem.
Configuration
Add this code to your ~/.emacs or ~/.emacs.d/init.el file:
;;;
;;; ELPA
;;;
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
How It Works
This configuration sets up three package repositories:
GNU ELPA (official):
("gnu" . "http://elpa.gnu.org/packages/")
The official GNU Emacs package repository. Contains stable, well-vetted packages that meet GNU's criteria. This is enabled by default in Emacs 24.
Marmalade:
("marmalade" . "http://marmalade-repo.org/packages/")
A community repository that accepts package uploads from any Emacs user. It's more permissive than GNU ELPA but less frequently updated than MELPA.
MELPA:
("melpa" . "http://melpa.milkbox.net/packages/")
The largest and most active repository. Packages are automatically built from their source repositories (usually GitHub), so you get the latest commits. This is where most active development happens.
The setq package-archives line replaces the default repository list with your custom configuration, giving Emacs access to all three sources when you browse or install packages.
Installation
- Edit your Emacs configuration file:
C-x C-f ~/.emacs RET(Or~/.emacs.d/init.elif you use that structure) - Add the configuration code shown above
- Save the file:
C-x C-s - Restart Emacs to load the new configuration
- Refresh package list:
M-x package-refresh-contentsThis downloads the package lists from all three repositories - Browse available packages:
M-x list-packages
Using the Package System
Once configured, installing packages is simple:
Browse and Install Interactively:
- Run
M-x list-packages - Browse the list (thousands of packages!)
- Press
ito mark a package for installation - Press
xto execute (install marked packages)
Install by Name:
M-x package-install RET package-name RET
Update Packages:
- Run
M-x list-packages - Press
Uto mark all upgradeable packages - Press
xto execute updates
Popular Packages to Try
Once MELPA is configured, try these essential packages:
magit – An incredible Git interface that makes version control intuitive and powerful
company-mode – Modern auto-completion framework
projectile – Project navigation and management
helm – Incremental completion and selection framework
markdown-mode – Major mode for editing Markdown files
paredit – Structured editing for Lisp code
auto-complete – Intelligent auto-completion
yasnippet – Snippet expansion system
Install any of these with: M-x package-install RET package-name RET
Benefits
Huge Package Selection: Access thousands of packages instead of the few hundred in GNU ELPA.
Automatic Updates: MELPA packages are rebuilt daily from source, so you get bug fixes and new features quickly.
Easy Installation: No more manually downloading files, managing load paths, or tracking updates.
Dependency Management: Packages automatically install their dependencies—no configuration required.
Discoverability:
Browse M-x list-packages to discover packages you didn't know existed.
Notes
Package Priority: When the same package exists in multiple repositories, Emacs uses version numbers to determine which to install. Generally, MELPA versions are newer than Marmalade or GNU ELPA.
Stability vs. Bleeding Edge: MELPA packages are built from the latest source commits. If you prefer stability, you can use MELPA Stable (not shown in this configuration), which only builds from tagged releases.
First-Time Setup:
The first time you run package-refresh-contents, it may take a minute to download all the package lists. This is normal—subsequent refreshes are much faster.
Package Management: In the package list buffer, useful keybindings:
i– Mark for installationd– Mark for deletionu– UnmarkU– Mark all upgradeable packagesx– Execute marked actionsh– Help
Auto-loading Packages:
Installed packages are automatically loaded when Emacs starts. You don't need to add require statements to your .emacs file.
View the original configuration on Gist.