How to Download Specific Version of Go?
Grace Collins
Solutions Engineer · Leapcell
To download and install a specific version of Go (Golang), you have several methods available depending on your operating system and preferences. Below are the most common approaches:
Key Takeaways
- Multiple methods to install specific Go versions – You can use the
go
command, download from the official website, or use package managers. - Managing multiple Go versions – Tools like
g
andasdf
help switch between different Go versions efficiently. - Environment setup is crucial – Properly configuring paths and linking Go versions ensures a smooth development experience.
1. Using the go
Command:
Starting from Go 1.5, you can install multiple Go versions using the go
command. Here's how:
-
Install the Specific Version:
Replace
1.18
with your desired Go version:go install golang.org/dl/go1.18@latest
-
Download the Version:
After installation, download the specific version:
go1.18 download
-
Verify the Installation:
Check the installed version:
go1.18 version
This method allows you to have multiple Go versions installed simultaneously. You can use
go1.18
(or your specified version) to run Go commands for that particular version. (go.dev)
2. Direct Download from the Official Website:
You can manually download the desired Go version from the official Go downloads page:
-
Visit the Downloads Page:
Navigate to https://go.dev/dl/.
-
Select the Version:
Find and download the specific version suitable for your operating system and architecture.
-
Install:
Follow the installation instructions provided on the website. This typically involves extracting the archive and setting up the environment variables. (go.dev)
3. Using Package Managers:
Depending on your operating system, you can use package managers to install specific Go versions:
-
Homebrew (macOS):
-
Install a Specific Version:
brew install go@1.18
-
Unlink Current Version and Link the Specific Version:
brew unlink go brew link --force go@1.18
-
Verify the Installation:
go version
This will display the Go version, confirming the installation. (berkayakcay.com)
-
-
Snap (Ubuntu):
-
Find Available Versions:
sudo snap info go
-
Install the Desired Version:
sudo snap install go --channel=1.18/stable --classic
-
Verify the Installation:
go version
This will display the Go version, confirming the installation. (askubuntu.com)
-
4. Managing Multiple Go Versions:
If you need to manage multiple Go versions, consider using tools like g
or asdf
. These tools allow for easy installation and switching between different Go versions.
-
Using
g
:-
Install
g
:curl -sSL https://git.io/g-install | sh -s
-
Install a Specific Go Version:
g install 1.18
-
Use the Installed Version:
g use 1.18
-
-
Using
asdf
:-
Install
asdf
:Follow the instructions at https://asdf-vm.com/guide/getting-started.html.
-
Add the Go Plugin:
asdf plugin-add golang
-
Install a Specific Go Version:
asdf install golang 1.18
-
Set the Version Globally or Locally:
asdf global golang 1.18 # or asdf local golang 1.18
-
FAQs
Use go install golang.org/dl/go<version>@latest
, then run <version> download
.
Use version managers like g
or asdf
for quick installation and switching.
Yes, use brew install go@<version>
and then link it using brew link --force go@<version>
.
Conclusion
By following these methods, you can download and manage specific versions of Go tailored to your development needs.
We are Leapcell, your top choice for hosting Go projects.
Leapcell is the Next-Gen Serverless Platform for Web Hosting, Async Tasks, and Redis:
Multi-Language Support
- Develop with Node.js, Python, Go, or Rust.
Deploy unlimited projects for free
- pay only for usage — no requests, no charges.
Unbeatable Cost Efficiency
- Pay-as-you-go with no idle charges.
- Example: $25 supports 6.94M requests at a 60ms average response time.
Streamlined Developer Experience
- Intuitive UI for effortless setup.
- Fully automated CI/CD pipelines and GitOps integration.
- Real-time metrics and logging for actionable insights.
Effortless Scalability and High Performance
- Auto-scaling to handle high concurrency with ease.
- Zero operational overhead — just focus on building.
Explore more in the Documentation!
Follow us on X: @LeapcellHQ