To get your Pi up and running, first download an OS. For beginners I suggest Raspbian. Its a Debian based OS maintained by the Raspberry Pi Foundation.
status=progress = required for showing output status as it writes the image
dd is colloquially known as 'disk destroyer' because if you're not careful you can write over your entire active disk destroying your system.. So be careful what you enter on the command line with dd!
Finally, once you have your SD card written, it will most likely mount the two new partitions automatically. You should see a ROOT and BOOT partition. If not, mount the BOOT partition briefly and navigate to it.
You can now add two small files to enable the SSH Server on boot, and connect to the wifi network of your choosing automatically. This way you never have to plug in a monitor / keyboard / mouse / etc.
The default credentials on a RaspiOS installation are: pi/raspberry
The very first thing you'll want to do, is update the apt cache and do an upgrade to get all the packages up-to-date from when the image was created until now.
sudo apt update && sudo apt upgrade -y
Then, some of the first packages I like to install on a headless system include:
sudo apt install -y net-tools vim git htop docker docker-compose software-properties-common build-essential zip unzip dnsutils
This will open a step-by-step wizard type of process which begins by asking for the new password. Then it asks for Fullname, City, State, etc. these fields I always leave empty.
You may also want to add your new user to the suders file in order to be able to use sudo .. commands.
With your preexisting pi user, run:
sudo usermod -aG sudo [new username]
Now your new user will be able to run sudo .. commands with their new password.
You can set a new hostname via sudo hostnamectl set-hostname [name]. You may also have to adjust the local hosts file to set the new hostname as 127.0.0.1.
sudo vim /etc/hosts
And adjust the lines for 127.0.0.1 and 127.0.1.1 to append your new hostname.
The latest version of RaspiOS is based upon Debian 10 Buster. To set a static IP there, we'll want to use dhcpcd. This systemd service and config is started by default in Buster, we'll just have to adjust some config files.
sudo vim /etc/dhcpcd.conf
There is a section around line 45 which is commented out describing how to setup a static ip. Simply uncomment this and provide the correct values for your network.
Once that is done, simply restart dhcpcd via systemctl
sudo systemctl restart dhcpcd
It may hang for a minute, but should come right back up because it will have retained your old IP address as well until the next reboot. So for now the device will be reachable under the IP you initially SSHed into it with, and the new IP you just set as static. Upon your next reboot only the new IP should be available.