First, download the binary file in https://github.com/mozilla/geckodriver/releases
With the binary downloaded, we need to extract the file with the command:
sudo tar -xvf geckodriver-v0.28.0-linux64.tar.gz
After that, move de extracted file to the directory /usr/local/bin/:
sudo mv geckodriver /usr/local/bin/
It's done.