How to install the Go programming language on your server or VPS?

Assuming you’ve logged in as root in Debian 5.0, to install the Go programming language by Google,

  1. Add these environmental variables for Go in .bash_profile:
    export GOROOT=$HOME/go
    export GOARCH=386  # for 32 bit architectures. Use GOARCH=amd64 for 64 bit architectures
    export GOOS=linux
    export GOBIN=$HOME/bin
    PATH=$PATH:$GOBIN
    
  2. Install the Mercurial ‘hg’ command:
    aptitude install mercurial
  3. Fetch the sources of Go and put them at $GOROOT:
    hg clone -r release https://go.googlecode.com/hg/ $GOROOT
  4. Fetch compilers and related utilities:
    aptitude install bison gcc libc6-dev ed make
  5. Create the directory $HOME/bin by:
    mkdir $HOME/bin

    and compile Go:

    cd $GOROOT/src
    make all

Done. You can now go about writing your first hello world program. If you haven’t got a server yet, I recommend Linode VPS and Rackspace Cloud.

2 thoughts on “How to install the Go programming language on your server or VPS?”

  1. What will i do for programming in GO language…
    what compiler/interpreter i will use ?
    and from where i’ll get it????
    and how can see the output ??????

    1. Well, I doubt it’d be as easy to use as with PHP because it’s meant to replace system programming languages such as C and C++. It sure can produce websites and web applications. But you’d definitely have to wait until some library comes out that makes the process easier for hobby programmers.

Comments are closed.

Scroll to Top