Ethereum - Ubuntu for Beginners
Last updated
Last updated
Goal: Teach basic Ubuntu concepts and skills in order to encourage home staking on Ethereum. The target audience is anyone with basic tech skills and a desire to learn.
This is part of a broader Ethereum educational effort. Find other Eth2 community resources here.
Ubuntu desktop has several features that make it ideal for running a validator on Ethereum 2.0:
Comprised of Free and Open-Source Software (FOSS)
Wide support and documentation with the Ethereum ecosystem
User friendly, easy to learn
Designed to boot as a live USB for generating Eth2 keys offline
Ubuntu is secure right out of the box and is generally resistant to viruses and malware. The best way to maintain a secure environment is to use it as a dedicated Ethereum machine. No other applications.
Ubuntu has both desktop and server versions. Servers have no graphical user interface (GUI), which means the only access to a server is through terminal commands (CLI).
Ubuntu desktop allows you to operate in a normal desktop environment (GUI) while still using CLI.
For most users, a home PC is easier to operate and more secure than a remote server because you have direct physical access, which allows you to disable remote logins and prevent the majority of attacks.
Windows
Ubuntu / Linux
Document Writer
Microsoft Word
LibreOffice Writer
Spreadsheets
Microsoft Excel
LIbreOffice Calc
Presentations
MS Powerpoint
LibreOffice Impress
Web Browser
Internet Explorer
Firefox
Photo Editor
Adobe Photoshop
GIMP
Image Editor
MS Paint
Image Magick
PDF Viewer
Adobe PDF
Document Viewer
Text Editor
Text
Text Editor
Email Client
MS Outlook
Thunderbird Mail
Command Line
Command Prompt
Terminal
Computer Settings
Control Panel
Settings
Software Updates
Windows Updater
Ubuntu Software
Open-source applications have come a long way in recent years, and many FOSS programs are now as good or better than their closed-source counterparts.
You can visually explore different directories and files using the Graphical User Interface (GUI)
Basic text editor for simple documents and copy/pasting
Running an Ethereum validator requires entering commands directly into the terminal (aka command line interface). CLI can be intimidating at first, but it's fairly intuitive and easy to learn.
You can use the following shortcuts for Linux CLI:
Ctrl + Alt + T
|| Open new terminal window
Ctrl + Shift + C
|| Copy selected contents from terminal window
Ctrl + Shift + V
|| Paste contents into terminal window
Ctrl + C
|| Stop a running terminal process
Up/down Arrows
|| Cycle through last used commands
This tool is helpful if you have an error and want to post a screenshot in the EthStaker Discord for help.
Open a terminal window with Ctrl + Alt + T
and move it alongside the file viewer. This allows you to see information displayed through Command Line Interface (CLI) and Graphical User Interface (GUI).
The screenshot below shows the contents of the Home directory through both CLI and GUI.
Linux systems do not have "drives" like with Windows (e.g. C: or D:).
The entire Linux directory system is a series of nested directories, with the top being the /root
directory.
The root directory contains all other directories, and the root user has control over the entire system. A mistake while working as root user can cause irreparable damage.
The best practice is to generally never use root access, and instead have regular users that can use the sudo
command
Adding sudo
to the front a command runs the terminal command as administrator. This helps prevent accidents because the user doesn't have root access, but they are still able to run commands as admin when needed.
If you get an error that you don't have permission to perform this action, you may need to use sudo
This guide was created on a PC named ubuntu
with the username ubuntu
You'll notice that CLI below starts with ubuntu@ubuntu
which identifies user@pcname
You can use the command whoami
to see the current user name.
When you open a new terminal, it will begin in the home directory
Directory
Description
/
Root directory
~
Home directory ( same as /home/YOURUSERNAME
)
~/Desktop
Desktop directory
~/Documents
Documents directory
~/Downloads
Downloads directory
/media/YOURUSERNAME
Directory for USB and other external devices
/var/lib/goethereum
Go Ethereum directory
/var/lib/lighthouse
Lighthouse directory
/var/lib/lighthouse/validator
Lighthouse validator directory
/var/lib/lighthouse/beacon
Lighthouse beacon directory
usr/local/bin
Directory used to run Lighthouse binary
This table shows a list of commands, but the following section will discuss in greater detail.
Command
Description
Sample Code
clear
clear terminal window (fresh screen)
clear
cd
change directory
cd ~
ls
list contents of current directory
ls
ls -l
show file permissions
ls -l sample.txt
pwd
print working directory (show current directory)
pwd
history
shows history of terminal commands
history
sudo
gives root permission to run programs or make changes
sudo
mkdir
make a new directory
sudo mkdir ~/test
nano
create or edit system files
sudo nano test.txt
rm
remove file
sudo rm test.txt
rm -r
delete directory and all contents (remove recursively)
sudo rm -r testfolder
cp
copy/paste a file
cp test.txt ~/Documents
chown
change ownership of a file/directory
sudo chown -R goeth:goeth
/var/lib/goethereum
chmod
change permissions of a file/directory
sudo chmod g+r sample.txt
adduser
create new user
sudo adduser mikejones
deluser
delete user
sudo deluser mikejones
update
update system database for new packages
sudo apt-get update
upgrade
upgrade packages (run after update)
sudo apt-get upgrade
install
install applications
sudo apt-get install geth
remove
remove applications
sudo apt-get remove geth
help
display help info (use -h
or -help
or --help
)
geth --help
Now that we've covered directories and commands, let's practice with a few exercises.
You can click the icon in the bottom left corner to show the installed applications.