Setting Up Windows for Go and Buffalo

Posted in administration programming with tags administration golang javascript windows -


This is a set of notes for setting up Windows 10 as a development system for the Go programming language, with the Buffalo Web framework. It does not use the Windows Subsystem for Linux.

What You Need

To work with Go, you only need three things:

  • Go itself
  • A text editor that understands Go, such as Atom
  • Git, for version control

To develop Web applications with Buffalo, you will also need two other pieces of software:

You should also install a C compiler, even if you do not write C code. Go and Node.js packages can use libraries that are written in C, and these packages will require a C compiler to install themselves.

Rather installing and updating these tools yourself, use a package manager. This tutorial explains how to set up the Scoop package manager and have it install the other software that you need.

If you download and install software yourself, always choose the 64-bit version. Only use 32-bit versions of Windows software if you know that you are using a 32-bit computer.

Setting Up the Scoop Package Manager

First, run this command in a PowerShell window:

Set-ExecutionPolicy RemoteSigned -scope CurrentUser

Press A when prompted. This ensures that PowerShell can run Scoop.

Enter this command in PowerShell to install Scoop:

iex (new-object net.webclient).downloadstring('')

Installing Go

To install Go using Scoop, enter this command in a PowerShell window:

scoop install go

If you do not use Scoop, go to the Go Web site and follow the Download Go link to find a Windows installer.

The Go tool will automatically create a folder called go in your user account when it is needed. This is your Go workspace. To ensure that Go applications run, you must add the bin folder in your workspace to your PATH. Run this in a PowerShell window to update your PATH:

[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$($env:HOMEDRIVE)$($env:HOMEPATH)\go\bin", [EnvironmentVariableTarget]::User)

Installing the Git Version Control System

To install Git using Scoop, enter this command in a PowerShell window:

scoop install openssh git

If you do not use Scoop, go to the Git Web site and follow the link for Downloads to find a Windows installer.

Configuring Git

Once you have installed Git on a system, set your details. These are automatically applied to every commit that you make. This requires two commands:

git config --global "Your Name"
git config --global ""

The global option means that the setting will apply to every repository that you work with in the current user account.

Creating SSH Keys

You will frequently use SSH to access Git repositories or remote UNIX systems. The Git package includes the standard OpenSSH suite of tools.

To create an SSH key, run the ssh-keygen command in a Git terminal window. For example:

ssh-keygen -t rsa -b 4096 -C "Me MyName (MyDevice) <>"

Use 4096-bit RSA keys for all systems. The older DSA standard only supports 1024-bit keys, which are now too small to be considered secure.

For more on how to use SSH with GitHub, see the GitHub setup guide. GitHub also provide tips for troubleshooting SSH problems.

Installing a Text Editor

The Notepad text editor in Windows is designed for light-weight word processing, and has no support for programming. If you do not have a favourite text editor, Visual Studio Code and Atom are high-quality and customisable editors that have well-maintained plugins for Go. All of these editors are provided free of charge. If you would prefer to use an IDE, JetBrains offer GoLand as a commercial product.

Setting Up Atom

To install Atom, download the latest version from the project Website.

Current versions of Atom include support for Git. You will massively improve your experience with your text editor by installing a few more plugins to it.

To install Atom packages, either choose or use the apm command in a terminal window. Run this command to add the go-plus package, which turns Atom into a development environment for Go:

apm install go-plus

The next time that you open Atom, you will see go-plus automatically download and configure all of the tools that it needs. go-plus will ask you to restart Atom once for the changes to take effect.

Run this command to install other useful packages for Atom:

apm install file-icons linter-csslint linter-eslint linter-js-yaml

The file-icons package adds colourful icons for different types of file. Linter packages automatically check your files for errors and other potential problems. Each linter works with specific types of file. For example, the ESLint plugin checks JavaScript files.

Installing Node.js

Node.js is the run-time for JavaScript. It also includes npm, a package manager for JavaScript.

To install Node.js using Scoop, enter this command in a PowerShell window:

scoop install nodejs-lts

This installs the current LTS (Long-term Support) version of Node.js. The Node.js project provides other versions that are specifically for early-adopters.

If you do not use Scoop, go to the Node.js Web site and follow the link for Downloads to find a Windows installer.


If you are not sure which database product to use, install PostgreSQL. PostgreSQL is a full SQL database product with support for advanced features such as full-text search and JSON document storage. Use PostgreSQL for Web applications. The default configuration of PostgreSQL only uses a small amount of memory and CPU, so you can install it even on computers with limited resources.

Installing PostgreSQL

To install PostgreSQL using Scoop, enter this command in a PowerShell window:

scoop install postgresql

This does not create databases, or start the PostgreSQL service. Before you start the service, create the required directories and databases:

mkdir $env:HOMEPATH\pgsql\databases
mkdir $env:HOMEPATH\pgsql\logs
pg_ctl initdb -D $env:HOMEPATH\pgsql\databases

To start PostgreSQL:

pg_ctl -D $env:HOMEPATH\pgsql\databases -l $env:HOMEPATH\pgsql\logs\server.log

Once PostgreSQL is running, test it by logging in with the psql utility:

psql -d template1

This sets the working database as the standard template1 database. Once you have logged in, enter \q to exit the console.

Use the _pgctl utility to manage PostgreSQL:

pg_ctl --help

Installing a C Compiler

GCC is the standard compiler and tools for Free and Open Source libraries that are written in the C programming language. The mingw-w64 project provide releases of GCC for Windows.

To install GCC using Scoop, enter this command in a PowerShell window:

scoop install gcc

Installing Buffalo

To install Buffalo, enter this command in a PowerShell window:

go get -u -v

Once it is installed, use the buffalo utility to create and manage your Web applications.

Updating Your Tools

Use Scoop to upgrade your software as new versions become available.

To update the index of available packages, run this command in a PowerShell window:

scoop update

To upgrade a specific application, give the name of the product as an option to the scoop update command. For, example this command upgrades Go:

scoop update go

To upgrade all of the software that Scoop manages, use an asterisk instead of the name of an application:

scoop update *

Atom has a built-in update system. It will automatically display a message when you should update either the editor, or one of the packages that you have installed.

To upgrade Buffalo, enter this command in a PowerShell window:

go get -u -v

The -u option means that if you already have a copy of Buffalo, it will be upgraded.