In this chapter, you'll learn how to install Buffalo, either from pre-built binaries or from source.
Buffalo provides two major components:
buffalotool, a powerful toolbox to help you develop in a fast and efficient way.
- The buffalo framework, a collection of pieces to construct your app.
Buffalo is currently available and tested on the following platforms:
- Mac OSX
Before installing make sure you have the required dependencies installed:
- A working Go environment
- A configured
$PATHenvironment variable that includes
- Go version
The following requirements are optional. You don't need them if you want to build an API or if you prefer to build your app in an old-fashioned way.
Database Specific Requirements
Again, if you don't need a database, you won't need these.
- SQLite 3: GCC, or equivalent C compiler for mattn/go-sqlite3.
Installation from a release archive - 64 bits
v0.10.3, pre-compiled archives are provided with each release. If you don't need the latest cutting-edge version, you'll probably prefer to install this version.
GNU / Linux
$ wget https://github.com/gobuffalo/buffalo/releases/download/v0.15.0/buffalo_0.15.0_linux_amd64.tar.gz $ tar -xvzf buffalo_0.15.0_linux_amd64.tar.gz $ sudo mv buffalo /usr/local/bin/buffalo
$ curl -OL https://github.com/gobuffalo/buffalo/releases/download/v0.15.0/buffalo_0.15.0_darwin_amd64.tar.gz $ tar -xvzf buffalo_0.15.0_darwin_amd64.tar.gz $ sudo mv buffalo /usr/local/bin/buffalo # or if you have ~/bin folder setup in the environment PATH variable $ mv buffalo ~/bin/buffalo
Buffalo can be installed using the Scoop package manager:
PS C:\> scoop install buffalo
brew install gobuffalo/tap/buffalo
GoFish is a cross-platform systems package manager, that works across Windows, MacOSX and Linux.
After you have GoFish installed, you can very simply install Buffalo:
$ gofish install buffalo ==> Installing buffalo... 🐠 buffalo 0.15.0: installed in 3.223672926s
Custom installation with SQLite3 Support
SQLite 3 requires a GCC, or equivalent C compiler for mattn/go-sqlite3 to compile. You must have a GCC installed first before installing Buffalo.
To install Buffalo, ensure your
GOPATH is defined, then:
$ go get -u -v -tags sqlite github.com/gobuffalo/buffalo/buffalo
Windows Users: Follow the installation guide at https://blog.gobuffalo.io/install-buffalo-on-windows-10-e08b3aa304a3 to install a GCC for Windows 10. Alternatively, GCC can be installed with the Scoop package manager:
PS C:\> scoop install gcc
Custom installation without SQLite3 Support
$ go get -u -v github.com/gobuffalo/buffalo/buffalo
Verify your installation
You can check if your installation is working, by executing the
buffalo command in a terminal/command prompt:
$ buffalo Helps you build your Buffalo applications that much easier! Usage: buffalo [command] Available Commands: build Builds a Buffalo binary, including bundling of assets (packr & webpack) db A tasty treat for all your database needs destroy Allows to destroy generated code. dev Runs your Buffalo app in 'development' mode generate A collection of generators to make life easier help Help about any command info Prints off diagnostic information useful for debugging. new Creates a new Buffalo application setup Setups a newly created, or recently checked out application. task Runs your grift tasks test Runs the tests for your Buffalo app update will attempt to upgrade a Buffalo application to version v0.15.0 version Print the version number of buffalo Flags: -h, --help help for buffalo Use "buffalo [command] --help" for more information about a command.
If you have a similar output, your Buffalo toolbox is ready to work!