This page is currently under construction. See some suggestions at Developer docs: setting up a local development environment.
To develop for Backdrop CMS, you should set up a local Backdrop installation on your computer where you will do your development, whether for Backdrop core, or to develop or add to one of the many contributed Backdrop modules.
There are many resources on the internet on how to set up a local development environment. Some computer operating systems have some built-in support for web development, while others will require the installation of external tools. Both free/open-source and commercial tools are available. An exhaustive discussion is beyond the scope of this documentation, but we'll describe some approaches and some of the key considerations to help you on your way.
A good place to start for background is to read through the documentation on Hosting and deploying; although this section is geared toward the hosting of a public-facing Backdrop site, some of the considerations will be the same for a locally hosted site.
The minimum tools you will need to do local development are:
- A web server (like apache or nginx) configured to handle PHP;
- A database server, like MySQL or MariaDB;
- A web browser, to examine the results of your coding.
There are many options available that offer the above requirements in a single bundle, and most of them also provide easy control panels that allow you to configure/tweak each individual component. These applications range from free/open-source, to paid/commercial. Some of them are:
- WampServer or Wnmp if you are on Windows
- MAMP if you are Mac OS (version for Windows also available)
- LAMP if you are Linux (multiple options available, depending on your Linux distribution)
- XAMPP which supports all popular operating systems
- Docker-based solutions, such as Lando / DDEV / Docksal
There are, of course, many more tools that you might consider using in order to streamline or enhance your development experience:
- A text editor that supports syntax coloring, autocompletion, etc. (e.g., Sublime Text, Notepad++, Notepad2-mod, ...)
- Integrated development environments (e.g., PHPStorm, Visual Studio Code, ...)
- GUI Git clients (e.g., GitHub Desktop, Tower (Mac), ...)
- GUI MySQL clients (e.g., Table Plus, Sequel Pro, Sequel Ace, Beekeeper Studio, ...)
But those are not absolutely required; much development can be done using command-line tools.
The overall workflow for developing for Backdrop core is:
- Fork the Backdrop core code from GitHub into your personal GitHub repository.
- Clone this forked repository to your local computer.
- Set up a local website on your computer that uses the cloned repository as its source code.
- Make your changes to the local code and test it locally.
- When ready, submit a Pull Request (PR) with your changes (and link the PR to the corresponding Backdrop issue).
On this page and its sub-pages, we'll focus on those first steps: how to get a local website up and running based on the GitHub cloned repository of Backdrop core code.
(Note: the process of setting up a development environment for a Backdrop contrib project is similar, but has some differences. For the moment, we'll focus on developing for Backdrop core.)
MORE TO COME