Golang Hosting
The PaaS is a truly multilingual cloud platform, offering support for Java, PHP, Python, Ruby, Node.js, .NET, and now Go environments for running projects of all sizes and various types.
In this guide, you’ll become familiar with the unique features of Go hosting and explore the Go-related capabilities within the platform. Use the table of contents below to quickly locate the information you need:
- Go Environment Hosting
- Golang Versioning
- Go Application Deployment
- Domains Management
- Automatic Vertical Scaling
- Manual Horizontal Scaling
- Automatic Horizontal Scaling
Go Environment Hosting
To host your Go application, you need to create the appropriate environment using the Topology Wizard.
1. Switch to the Go engine tab.
2. Add Golang as your application server and include any other software stacks required for your project (e.g., load balancers, databases, or shared storage).
3. Adjust your environment’s node count, set cloudlet limits for RAM and CPU, attach public IPs, etc., if needed.
Need help setting up your environment? Check out our Create Environment guide!
Golang Versioning
As of now, the platform supports the following versions of the Golang stack template:
- 1.22.3
- 1.22.2
- 1.22.1
- 1.21.10
- 1.21.9
- 1.21.8
- 1.20.14
- 1.20.13
- 1.20.12
- 1.19.12
- 1.19.11
- 1.19.10
You can select the preferred version during environment creation and change it later by redeploying the container. All custom data within the node(s) will be preserved, enabling you to easily upgrade your software version when a new stack template is released.
Go Application Deployment
After creating your environment, you can deploy your Go project from a Git repository (deployment from an application archive will be available in the upcoming platform release).
You can customize the deployment process by configuring the following container variables:
- GO_RUN: Specifies the name of the executable binary file (if not set, the deployment script will try to locate one based on the Git project name).
- OPATH: Defines the deployment folder (default is `/home/jelastic/webapp`).
- GO_BUILD_OPTIONS: Provides additional options for the build operation (default is `-a` to force rebuilding of packages that are already up-to-date).
- GO_RUN_OPTIONS: Provides additional options for the run operation.
During deployment, the platform automatically performs the following steps:
- Parses the provided Git URL to get a link to the Go project.
- Downloads the package with all the dependencies using the `go get` command.
- In case of error, it performs a download as for a common Git project and retries getting the Go dependencies.
- Builds the project with the `go build` command (using the additional options specified in the `GO_BUILD_OPTIONS` variable).
- Runs the binary defined by the `GO_RUN` variable with the `go run` command (using the additional options specified in `GO_RUN_OPTIONS`).
After successful deployment, the Go project is located in the directory set with the `GOPATH` variable. The workspace hierarchy inside follows the requirements outlined in the official documentation.
For more information about Go application deployment, refer to the following documents:
Domains Management
With the platform, you can easily bind an external (custom) domain name to your Go application, replacing the default environment domain. Depending on the entry point used, there are two options:
- CNAME Redirect: Recommended for dev and test environments using the Shared Load Balancer.
- DNS A Record: Suitable for production environments with a public IP, as it can handle high traffic loads.
Additionally, you can effortlessly swap domains to redirect traffic from one environment to another (e.g., to switch to a newer application version without downtime).
Automatic Vertical Scaling
Automatic vertical scaling is facilitated by the platform’s ability to dynamically allocate resources (RAM and CPU) to a server within predefined limits based on its current demands, without requiring manual intervention. This feature ensures you never overpay for unused resources and saves time by eliminating the need to manage load-related adjustments or architectural changes.
The scaling process is automatically managed by the platform. You simply need to specify the lower and upper cloudlet limits (each cloudlet equals 128 MiB of RAM and 200 MHz of CPU) for your Go server through the topology wizard:
Your application will operate within these limits, reducing resource consumption when the load is low and increasing it when the load is high. This way, you only pay for the resources consumed. For more information, please refer to the automatic vertical scaling documentation.
Manual Horizontal Scaling
Additional Golang servers can be easily added via the topology wizard during environment creation or adjustment. Simply click the “+” button in the Horizontal Scaling section and add the desired number of instances.
The maximum number of same-type servers within a single environment layer depends on the specific hosting provider’s settings (usually this limit is 16 nodes, which can be increased by sending a request to support).
Additionally, when scaling Golang servers, a load-balancing node is automatically added to the environment topology to ensure proper request distribution. For more details about manual horizontal scaling, refer to the documentation.
Automatic Horizontal Scaling
Automatic horizontal scaling is achieved through configurable triggers that increase or decrease the number of nodes based on application load. To set up automatic scaling, click the Add button to Settings > Auto Horizontal Scaling in your environment.
You can then configure triggers for specific stacks and resources (CPU, RAM, Network, Disk) by setting the scaling conditions.
Learn more about automatic horizontal scaling in the relevant documentation.
Additional Features and Functionality of the Platform’s Go Hosting
- Custom or Built-In SSL
- Public IPv4 and IPv6
- Wide Choice of Managed Databases
- Container Firewalls, Endpoints, and Environment Isolation
- User-Friendly UI and Direct SSH Access for Management
- Open API and Cloud Scripting for Automation
- Pay-As-You-Use Pricing Model
- Collaboration Functionality for Teamwork
- Multi-Cloud Distribution
The Go cloud hosting is ready to support your development, testing, and production environments.






