# CoreOS baremetal server installation
Jan 16, 2017 2 minute readCoreOS is a lightweight Linux distribution designed specifically to run containers. Unfortunately its installation on baremetal servers is not as streamlined as other Linux distributions. These are the steps I took to install CoreOS on a couple of physical machines.
Prerequisites
- 
    
Generate a
cloud-config.ymlfilecat > cloud-config.yaml <<EOL #cloud-config ssh-authorized-keys: - `cat id_rsa.pub` EOLThis
cloud-config.yamlcan be reused to provision multiple computers - 
    
Copy the
cloud-config.yamlfile to a flash drive
Additionalcloud-config.yamlhelp 
Prepare the installation
- 
    
Connect the computer to the LAN
 - 
    
Boot up from the CD
 - 
    
Wait until a command prompt appears
More information on the CoreOS installation to disk 
Copy the cloud-config.yaml into the server
- 
    
Plug in the flash drive with the
cloud-config.yaml - 
    
List the physical disks
lsblk - 
    
Determine what is the first partition of the USB drive. In this example we’ll use
/dev/sdb1where/dev/sdbis the physical device - 
    
Copy the
cloud-config.yamlsudo su - root mkdir ~/flash mount -o ro /dev/sdb1 ~/flash cp ~/flash/cloud-config.yaml ~/ umount /dev/sdb1 rm -Rf ~/flash - 
    
Unplug the flash drive
 
Run the installation
coreos-install -d /dev/sda -c ~/cloud-config.yaml
reboot
At this point the server should boot up using DHCP. Its console will display its IP and MAC address.
Remote into the server
ssh into the box using your private RSA key
ssh -i id_rsa [email protected]
Success!
BONUS: Configure the network to use a static IP
- 
    
List the Network Interfaces
ifconfig - 
    
Determine the name of the Ethernet Adapter. In this example we’ll use
eno1 - 
    
Execute the following commands using the appropriate values for your network
sudo su - root cat > /etc/systemd/network/static.network <<EOL [Match] Name=eno1 [Network] Address=192.168.1.10/24 Gateway=192.168.1.1 DNS=8.8.8.8 EOL reboot 
At this point the server should boot up using the new IP.