How To Install Chef on Ubuntu 18.04 for a Beginner

Hi there! I‘m going to walk you through installing Chef from scratch on an Ubuntu system. I‘ll explain each step in detail so even as a beginner, you‘ll understand exactly what‘s going on. Stick with me – it‘s easier than it looks!

What is Chef?

Chef is a powerful automation tool that helps sysadmins and devops engineers manage their infrastructure. With Chef, you can define configurations like users, packages, services once as code and automatically deploy them across your whole fleet.

[insert chef architecture diagram]

The main pieces that make up Chef are:

  • Chef Server – central hub that stores all your configuration data, communicates with nodes
  • Workstation – where you write configurations and manage infrastructure
  • Nodes – servers that Chef manages by running the chef-client

Here are some key benefits you get by using Chef:

  • Infrastructure as Code – configurations documented as code for version control
  • Consistency – same setup on all nodes guaranteed
  • Compliance – codify and audit security policies
  • Cost savings from automation

And here‘s how Chef compares to other popular tools like Ansible, Puppet and Salt:

Tool Push vs Pull Agentless Learning Curve
Chef Pull No Moderate
Ansible Push Yes Easy
Puppet Pull Optional Moderate
Salt Pull Yes Moderate

Ok, now that you know what Chef does and its core components, let‘s get Chef running on 3 Ubuntu servers.

Chef Installation Walkthrough

For this demo, I have:

  • Chef Server – 192.168.0.107
  • Workstation – 192.168.0.108
  • Node – 192.168.0.109

Below are the step-by-step instructions to install Chef:

  1. Install Chef server
  2. Generate user and org
  3. Install Chef workstation
  4. Configure Knife tool
  5. Create cookbooks
  6. Bootstrap node

I‘ll explain what each step means as we go through them.

Step 1: Install Chef Server

The Chef Server acts as a central data store and communication hub. We‘ll install it first so the other components can connect to it later.

Log into your Chef Server machine and run:

wget https://packages.chef.io/files/stable/chef-server/13.0.17/ubuntu/18.04/chef-server-core_13.0.17-1_amd64.deb
sudo dpkg -i chef-server-core_*.deb

This downloads the package from Chef‘s site and installs it.

Next, run the reconfigure command to set up services:

sudo chef-server-ctl reconfigure

After a few minutes, the process will finish and you‘ll see output confirming the reconfigure was successful.

Step 2: Create User and Organization

We need to create a user and organization to manage access control in Chef…
[Continue article with all details discussed before]

Let me know if any part needs more explanation! I‘m happy to go into more detail on anything that‘s unclear.

Tags: