> For the complete documentation index, see [llms.txt](https://blog.micsoftvn.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blog.micsoftvn.com/use-cases/for-sysadmin/install-nginx-centos-7-or-docker.md).

# Install Nginx Centos 7 or Docker

**Step 1 — Adding the EPEL Software Repository**

```
sudo yum install epel-release
```

**Step 2 — Installing Nginx**

```
sudo yum install nginx
sudo systemctl start nginx
sudo systemctl status nginx
```

#### Install Nginx with Docker file

```
nginx-proxy:
image: nginx
restart: unless-stopped
ports:
- '80:80'
- '443:443'
volumes:
- /data/services/nginx/conf.d:/etc/nginx/conf.d:ro
- /data/services/letsencrypt:/etc/nginx/ssl:ro
- /etc/localtime:/etc/localtime:ro
```
