Skip to content

Quickstart: Deploy a Fiber App

This guide explains how to deploy a Fiber application to seenode. Fiber is an Express-inspired web framework built on top of Fasthttp, the fastest HTTP engine for Go.

Get started in seconds by deploying our pre-configured Fiber template. This example is ready to deploy and reflects the structure discussed in this guide.

Follow these steps to prepare and deploy your Fiber project.

  1. Prepare Your Project for Production

    Your project structure should be ready for deployment.

    Project Structure

    A minimal Fiber project contains a main.go entry point and a go.mod file.

    • Directoryyour-fiber-project/
      • main.go // The application entry point
      • go.mod
      • go.sum

    Dependencies

    Make sure your go.mod lists gofiber/fiber as a dependency.

    go.mod
    module your-fiber-project
    go 1.21
    require github.com/gofiber/fiber/v2 v2.52.0

    Run

    go mod tidy
    to create your go.sum file.

    Alternative Setup

    If you want to start from scratch, you can set up a new Fiber project with these commands:

    Terminal window
    # Install Go (if you haven't yet)
    sudo apt update && sudo apt install golang-go
    # Create a new project
    mkdir your-fiber-project
    cd your-fiber-project
    go mod init your-fiber-project
    go get github.com/gofiber/fiber/v2

    Application Code

    Your main.go file should create a Fiber server that listens on a port defined by an environment variable. This allows seenode to correctly route traffic to your application.

    main.go
    package main
    import "github.com/gofiber/fiber/v2"
    func main() {
    app := fiber.New()
    app.Get("/", func(c *fiber.Ctx) error {
    return c.SendString("Hello, Welcome to seenode 👋")
    })
    app.Listen(":80")
    }

    Testing Locally

    You can test your application locally by running:

    go run main.go
  2. Deploy on seenode

    Follow these steps to deploy your Fiber application:

    1. First, create a new Web Service from the seenode Dashboard and connect your Fiber project’s Git repository.
    2. Configure your build and start commands. seenode will attempt to detect these automatically.
      • Build Command:
        go build -o app main.go
      • Start Command:
        ./app
    3. Choose your preferred instance size and create your service.
    4. Watch your deployment progress in real-time through the Logs tab.
    5. Once complete, your Fiber application will be accessible via your service’s URL.

Now that your Fiber application is deployed, here are some things you might want to do next: