DevOps sounds like an endless list of tools, but beginners learn it in a fixed order because each tool builds on the one before: Linux, Git, containers, orchestration, automation and monitoring. This guide follows that order with commands and small exercises for each step, and ends with the questions DevOps interviews ask. For the AWS services these tools run on, see our AWS for Beginners guide.
Contents
- 1. The cloud and DevOps roadmap
- 2. Linux commands every DevOps learner needs
- 3. Linux users, groups and permissions
- 4. Bash scripting basics
- 5. Git and GitHub: first commit to first pull request
- 6. Git branching, merging and conflicts
- 7. Docker basics
- 8. Docker images and Dockerfiles
- 9. Docker volumes
- 10. Docker Compose
- 11. Kubernetes: pods, deployments and services
- 12. Kubernetes ConfigMaps and Secrets
- 13. CI/CD explained
- 14. Your first Jenkins pipeline
- 15. Terraform: infrastructure as code
- 16. Ansible: configuration management
- 17. Monitoring with Prometheus and Grafana
- 18. DevOps interview questions
1. The cloud and DevOps roadmap
Cloud engineers set up and manage servers, storage and networks on platforms such as AWS; DevOps engineers automate how software is built, tested and released so teams ship faster with fewer errors. Learn in this order:
- Linux: commands, users, permissions, logs and shell scripts.
- Cloud basics: virtual servers, storage, networks and access control on AWS.
- Git and GitHub: version control for every project.
- Docker: package an application with everything it needs.
- Kubernetes: run and heal containers at scale.
- Automation: CI/CD with Jenkins, servers configured with Ansible, infrastructure with Terraform.
- Monitoring: metrics, dashboards and alerts.
These skills lead to roles such as cloud support engineer, cloud or AWS associate, DevOps engineer and Linux administrator. To show an employer, keep one repository containing a Linux script, a Dockerfile, a pipeline file and a README explaining what each does and what you would improve next.
2. Linux commands every DevOps learner needs
- Moving around:
pwd,ls -l,cd,catandless. - Changing and searching files:
cp,mv,rm,grep, andnanoorvimto edit. - Processes and permissions:
psandtop;chmod(who may read, write or execute) andchown;sudoonly when needed.
Use a Linux virtual machine or free online terminal and complete one terminal-only task a day, such as finding every log line containing an error.
3. Linux users, groups and permissions
Every file and process belongs to a user and a group, and knowing who can read, write or run a file is part of setting up any server safely. whoami shows your user, id shows your IDs and groups, sudo useradd and sudo usermod create users and add them to groups, and groups lists a user’s groups. Practise on a virtual machine: create a test user, add them to a group, check their access to a folder, then remove them.
4. Bash scripting basics
DevOps engineers use Bash daily to check disk space, rotate logs, deploy builds and restart services.
#!/bin/bash
set -euo pipefail
APP_DIR="/opt/myapp"
if [ -f "$APP_DIR/app.jar" ]; then
echo "Build found"
else
echo "Build missing"; exit 1
fi
for server in web1 web2 web3; do
ping -c 1 "$server" > /dev/null && echo "$server up" || echo "$server down"
doneMake a script executable with chmod +x. No spaces around = in assignments, arguments arrive as $1, $2, and variables should always be quoted. Every command returns an exit code (0 is success, held in $?), and CI/CD tools rely on them, so exit non-zero on failure. set -euo pipefail stops on errors and unset variables; test destructive commands with echo first and run shellcheck. Practice: a script that warns when disk usage passes 80%.
5. Git and GitHub: first commit to first pull request
Git records every change so you can see what changed, return to a working version and collaborate without overwriting each other. Start with git init, git add and git commit, git status, git log, and git push and git pull. Then go from first commit to first pull request: create a GitHub repository, clone it, make a branch for one change, commit, push the branch, open a pull request and ask for a review. Write commit messages that say what changed and why (“Add login validation for empty password”), never just “fix”.
6. Git branching, merging and conflicts
git switch -c feature/login-page creates and moves to a branch; git switch main goes back. Name branches by purpose (feature/, fix/, docs/). To merge, switch to main and run git merge feature/login-page: if main has not moved it fast-forwards, otherwise Git creates a merge commit.
A conflict happens when both branches changed the same lines. Git marks them with <<<<<<<, ======= and >>>>>>>; decide the final code, delete the markers, then git add and git commit. Small, frequent merges keep conflicts small. A simple team flow: pull main, branch, commit small changes, push, open a pull request, let a teammate review while CI runs the tests, merge and delete the branch. git rebase main gives a straight history on your own branches, but never rebase commits teammates have already pulled.
7. Docker basics
Docker packages an application and everything it needs into a container that runs the same on a laptop, a test server and the cloud, ending “it works on my machine”. An image is a read-only template; a container is a running instance of it, and one image can start many containers; a Dockerfile is the recipe for building an image. Start by running a small web server image and opening it in a browser. Common mistakes: oversized images, passwords baked into images, and forgetting to map a port so the app runs but cannot be reached.
8. Docker images and Dockerfiles
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:8000"]FROM chooses the base image, WORKDIR sets the folder, COPY brings files in, RUN executes a build command, EXPOSE documents the port and CMD starts the app. Each instruction creates a cached layer, which is why requirements are installed before the code is copied: changing one line of code then does not reinstall every package. Build and run with docker build -t course-app:1.0 . and docker run -p 8000:8000 course-app:1.0. Use slim base images, a .dockerignore, runtime environment variables for secrets, a non-root user where possible, and pinned image versions so builds are reproducible.
9. Docker volumes
Containers are temporary: files written inside one can vanish when it is replaced. A volume stores data outside the container’s writable layer, so a database survives. A named volume (docker volume create mydata) is managed by Docker and suits databases; a bind mount shares a folder from your computer and suits development. Try it: write a file to a volume, replace the container and confirm the file is still there, then repeat without a volume and watch it disappear.
10. Docker Compose
Real applications need several containers, such as the app, a database and a cache. Compose describes them in one file:
services:
web:
build: .
ports:
- "8000:8000"
environment:
DB_HOST: db
depends_on:
- db
db:
image: mysql:8
environment:
MYSQL_DATABASE: appdb
MYSQL_ROOT_PASSWORD: change-me
volumes:
- dbdata:/var/lib/mysql
volumes:
dbdata:All services share a network, so the app reaches the database by the name db. Use docker compose up, ps, logs -f web and down (add -v only to delete data too). depends_on controls start order, not readiness, so add a health check or retry logic. Keep real passwords in an uncommitted .env file. Compose is ideal for development and testing; production often uses Kubernetes or a managed service.
11. Kubernetes: pods, deployments and services
Kubernetes runs containers across many machines and keeps them running. A cluster has a control plane that decides where workloads run and worker nodes that run them; if a pod or machine fails, a replacement starts.
- Pod: the smallest deployable unit, one or more containers sharing a network identity.
- Deployment: keeps the desired number of pods running and rolls out changes in stages (a rolling deployment).
- Service: a stable address for a changing set of pods, usually selected by labels.
- Liveness probe: tells Kubernetes when to restart a container; tune it to catch real failures, not slow but healthy apps.
Try it with a local cluster: create a deployment from a simple image, expose it as a service and scale it from two to four pods. Beginner mistakes: confusing pods with deployments, missing resource limits, and editing running pods by hand instead of changing the deployment file.
12. Kubernetes ConfigMaps and Secrets
The same image should run in development, testing and production; what changes is configuration, kept outside the image.
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
data:
DB_HOST: mysql-service
PAGE_SIZE: "20"Use ConfigMaps for plain settings and Secrets for sensitive values: kubectl create secret generic db-credentials --from-literal=DB_PASSWORD='...'. Secrets are only base64-encoded by default, not encrypted, so enable encryption at rest and restrict access with RBAC. Load both as environment variables with envFrom (updated only on pod restart) or mount them as files (updated when the ConfigMap changes). Never commit real secrets to Git; use a secrets manager or tools such as Sealed Secrets, and run kubectl rollout restart deployment/app after changes the app reads only at startup.
13. CI/CD explained
Continuous integration builds and tests every pushed change automatically, so breakages are found within minutes. Continuous delivery then prepares a release, such as a container image, and can deploy it to test or live environments. A simple pipeline: check out the code, install dependencies and build, run unit tests, build a Docker image, deploy to a test server. The pipeline must stop when tests fail, so a broken build never reaches packaging or deployment. Jenkins, GitHub Actions and GitLab CI share these ideas, so learn one well first. Validate releases in a staging environment, kept separate from production and its data, before customers see them.
14. Your first Jenkins pipeline
Jenkins is an automation server that runs build and test steps whenever code changes. A pipeline is the set of steps, a build is one run, and a Jenkinsfile describes the pipeline as code in your repository.
pipeline {
agent any
stages {
stage('Checkout') { steps { checkout scm } }
stage('Build') { steps { sh 'mvn -B package -DskipTests' } }
stage('Test') { steps { sh 'mvn -B test' } }
}
}Install Jenkins on a test machine or in a container, connect it to a Git repository, trigger a build and read the console output. Keep the pipeline in a Jenkinsfile so it is versioned with the code, store passwords and keys in Jenkins credentials, and make a failed test stop the pipeline.
15. Terraform: infrastructure as code
Infrastructure as code describes servers, networks and storage in files that can be versioned, reviewed and applied consistently. With Terraform, the same setup can be recreated exactly in another environment, changes are reviewed before they happen, and the files record what exists.
terraform init: prepare the folder and download providers.terraform plan: show what will change.terraform apply: make the changes.terraform destroy: remove what was created.
Terraform’s state file records what it manages; store it safely in shared remote storage and never edit it by hand. First exercise: create one small storage bucket, plan, apply, then destroy it.
16. Ansible: configuration management
Ansible configures many servers from one set of instructions instead of logging into each machine. The inventory lists servers grouped by role, a playbook is a YAML file of tasks, and modules do the work, such as installing a package or copying a file. It needs no agent on each server. Exercise: two Linux VMs, an inventory with both and a playbook that installs a web server. Run it twice: the second run reports no changes, because Ansible is idempotent and only changes what differs.
17. Monitoring with Prometheus and Grafana
Prometheus collects and stores metrics; Grafana displays them. Applications expose metrics on an HTTP endpoint such as /metrics, Prometheus scrapes them every few seconds, and exporters such as Node Exporter provide server CPU, memory and disk. Metric types are counters (only go up), gauges (go up and down) and histograms (distributions such as request duration).
rate(http_requests_total[5m])
rate(http_requests_total{status="500"}[5m])Counters are almost always wrapped in rate(), giving requests per second and the server error rate. In Grafana, add Prometheus as a data source and build panels showing the four golden signals: traffic, errors, latency and saturation. Alerting rules through Alertmanager should fire on symptoms users feel, such as a sustained error rate, not every small spike. Lab: run Prometheus, Node Exporter and Grafana with Docker Compose, import a Node Exporter dashboard and create one high-CPU alert. On AWS, CloudWatch plays a similar role (see the AWS guide).
18. DevOps interview questions
- Docker image vs container? An image is a read-only template; a container is a running instance of it.
- What is a Dockerfile? The instructions to build an image: base image, files to copy and the command to run.
- What is a Docker volume for? Storing data outside a container’s writable layer so it survives replacement.
- What does chmod do? Changes whether the owner, group or others may read, write or execute a file.
- Describe a CI/CD pipeline. Git push triggers Jenkins to build, test and package a Docker image, then deploy to a test server; it stops if tests fail.
- Why Terraform instead of the console? Infrastructure becomes versioned, reviewed and reproducible.
- Pod vs deployment vs service? A pod runs containers, a deployment keeps the right number of pods and rolls out changes, a service gives them a stable address.
- What is a rolling deployment? Replacing instances in stages, with health checks and limits so capacity stays available.
- Why pin image versions? To make builds reproducible; update the pin deliberately for fixes and features.
- A container exits immediately. What do you check? Its logs and exit code: did the main command fail, or simply finish?
- Why separate staging and production? To validate releases safely, with separate access and no copied private data.
For more, see the AWS and DevOps questions and answers, recent changes in Kubernetes and cgroup v2, and three cloud projects for a fresher portfolio.
Learn DevOps with ScholarLogic
Linux, Git, Docker, Kubernetes, Jenkins, Terraform and Ansible are practised in live labs in the Cloud Computing, AWS and DevOps course in Bangalore at ScholarLogic, BTM Layout. Book a free demo class and a counsellor will share the fee and the next batch dates. To book, call 78923 93639.
