This brief tutorial shows students and new users how to install Chef automated server on Ubuntu 20.04 | 18.04.
Chef is a popular configuration management tool that allows IT admins to automate the deployment, management, and secure maintenance of IT resources across in an environment.
Chef has basically three components: Chef Workstation or Desktop, Chef Server and Chef Client/Node.
We discussed how to install Check Workstation here.
Chef server is the center of the operation. It stores, manages, and provides configuration settings to all Chef components.
The previous post showed you how to install Chef workstation. This post shows you how to install Chef server, its central repository that manages all componets.
To get started with installing Chef server, follow the steps below:
Before installing Chef server, you’ll want to update Ubuntu and install some basic tools to download Chef packages. To do that, run the commands below:
sudo apt update sudo apt install curl wget
After that, set the Ubuntu server hostname. For this post, we’re going to use chef.example.com as the server hostname.
Run the commands below to set it.
sudo hostnamectl set-hostname chef.example.com
You may also configure its host record in the /etc/hosts file.
sudo nano /etc/hosts
Then add a line to reference the server IP.
Save the file and exit.
Download and Install Chef Automate
Now that the Ubuntu server is prepared, use the commands below to download Chef server packages. You can visit this download site to find the latest version to download.
cd /tmp wget https://packages.chef.io/files/stable/chef-server/13.0.17/ubuntu/18.04/chef-server-core_13.0.17-1_amd64.deb
After downloading the server packages, run the commands below to install.
sudo apt install ./chef-server-core_13.0.17-1_amd64.deb
Wait for the installation to complete. Once done, run the commands below to accept its licensing terms and configure the server’s services.
sudo chef-server-ctl reconfigure
You should see something similar to the lines below:
---------------------------------------------+ Chef License Acceptance Before you can continue, 3 product licenses must be accepted. View the license at Licenses that need accepting: * Chef Infra Server * Chef Infra Client * Chef InSpec Do you accept the 3 product licenses (yes/no)? > yes
Chef comes with a utility to manage basic tasks like creating the admin account, organization and others. To create an admin account, use the comment format:
sudo chef-server-ctl user-create USER_NAME FIRST_NAME LAST_NAME EMAIL 'PASSWORD' --filename FILE_NAME
An RSA key will be generated in the filename specified.
For example, to create a new admin account with full name Super Admin and store it in your home folder, run the commands below:
sudo chef-server-ctl user-create chefadmin Super Admin email@example.com 'type_strong_password' --filename ~/chefadmin.pem
After that, you’ll also want to create an organization. Run the commands below to create an organization.
sudo chef-server-ctl org-create example "Example INC." --association_user chefadmin --filename ~/example-org.pem
Full details of the option above
- example – Organization short name. Must begin with a non-white space character.
- “Example INC.” – Organization full name
- –association_user – the admin account created earlier
- –filename – filename to store the RSA key for validation
Install Chef Manage
Chef Mange is a premium add-on that allows you to use a web interface to manage Chef tasks. If free up to 25 nodes. To install Chef Manage, run the commands below:
sudo chef-server-ctl install chef-manage sudo chef-server-ctl reconfigure sudo chef-manage-ctl reconfigure sudo chef-manage-ctl reconfigure --accept-license
When you’re done, login to the web interface using the server hostname or IP address.
That should bring up Chef Mange web portal.
Login with the admin account created above and begin setting up some basic tasks.
This post showed you how to install Chef Server on Ubuntu 20.04 | 18.04. If you find any error above, please use the form below to report.
You may also like the post below: