Getting Started

Using the Fyne toolkit to build cross platform applications is very simple but does require some tools to be installed before you can begin. If your computer is set up for development with Go then the following steps may not be required, but we advise reading the tips for your operating system just in case. If later steps in this tutorial fail then you should re-visit the prerequisites below.

Prerequisites

Fyne requires 3 basic elements to be present, the Go tools (at least version 1.12), a C compiler (to connect with system graphics drivers) and a system graphics driver. The instructions vary depending on your operating system, choose the appropriate tab below for installation instructions.

Note that these steps are just required for development - your Fyne applications will not require any setup or dependency installation for end users!

  • Windows
  • macOS X
  • Linux
  • Raspberry Pi
  • BSD
  • Android
  • iOS
  • Termux (create Android apk without PC - on Android)

Downloading

When using Go modules (required with Go 1.16 and later), you will need to set up the module before you can use the package.

Go modules (for Go 1.16 or newer)

If you are not using modules or you already have your module initialized, you can skip this to the next step. Run the following command and replace MODULE_NAME with your preferred module name (this should be called in a new folder specific for your application).

$ cd myapp
$ go mod init MODULE_NAME

You now need to download the Fyne module and helper tool. This will be done using the following commands:

$ go get fyne.io/fyne/v2@latest
$ go install fyne.io/fyne/v2/cmd/fyne@latest

If you are unsure of how Go modules work, consider reading Tutorial: Create a Go module.

Older Go installations

To install the Fyne toolkit and helper using an older Go release simply execute the go get commands:

$ go get fyne.io/fyne/v2
$ go get fyne.io/fyne/v2/cmd/fyne

Check your installation

Before coding an app or running an example you can check your install using the Fyne Setup tool. Simply download the right app for your computer from the link and run it, you should see something like the following screen:

If there are any problems with your installation see the troubleshooting section for hints.

Run the demo

If you want to see the Fyne toolkit in action before you start to code your own application, you can see our demo app running on your computer by executing:

$ go run fyne.io/fyne/v2/cmd/fyne_demo@latest

Please note that the first run has to compile some C-code and can thus take longer than usual. Subsequent builds reuse the cache and will be much faster.

Older Go version

To run the demo on an older version of Go, simply execute the follwing command instead:

$ go run fyne.io/fyne/v2/cmd/fyne_demo

Installing

If you want to, you can also install the demo using the following command (requires Go 1.16 or later):

$ go install fyne.io/fyne/v2/cmd/fyne_demo@latest

For earlier versions of Go, you need to use the following command instead:

$ go get fyne.io/fyne/v2/cmd/fyne_demo

If your GOBIN environment has been added to path (should be by default on macOS and Windows), you can then run the demo:

$ fyne_demo

And that’s all there is to it! Now you can write your own Fyne application in your IDE of choice. If you want to see some Fyne code in action then you can read your first application.