OpenResty is an Nginx-based web platform that can run Lua scripts using its LuaJIT engine. It has many built-in Nginx modules that can make it a powerful web app server. OpenResty allows you to use Lua scripts inside the Nginx conf files and write a high-performance web application in Lua without installing any package.
In this post, we will show you how to install OpenResty on Rocky Linux 10.
Step 1 – Install OpenResty on Rocky Linux 10
By default, the OpenResty package is not included in the Rocky Linux 10 default repo, so you will need to add the OpenResty repo to your system. You can add it with the following command:
nano /etc/yum.repos.d/openresty.repo
Add the following lines:
[openresty] name=Official OpenResty Repository for RHEL/CentOS baseurl=https://openresty.org/package/rocky/9/$basearch gpgcheck=0 enabled=1
Once the repo is added, run the following command to install OpenResty on Rocky Linux 10.
dnf install openresty -y
After the installation, verify the OpenResty version using the following command:
openresty -v
You will get the following output:
nginx version: openresty/1.27.1.2
You can also install the OpenResty CLI utility using the following command:
dnf install openresty-resty -y
Next, start and enable the OpenResty service using the following command:
systemctl start openresty systemctl enable openresty
You can also check the status of OpenResty with the following command:
systemctl status openresty
You will get the following output:
● openresty.service - The OpenResty Application Platform Loaded: loaded (/usr/lib/systemd/system/openresty.service; disabled; preset: disabled) Active: active (running) since Thu 2025-10-16 08:16:24 EDT; 3s ago Invocation: f8cbaf01bad3409cb6b3e91190e07b06 Process: 2208 ExecStartPre=/usr/local/openresty/nginx/sbin/nginx -t (code=exited, status=0/SUCCESS) Process: 2211 ExecStart=/usr/local/openresty/nginx/sbin/nginx (code=exited, status=0/SUCCESS) Process: 2216 ExecStartPost=/bin/sleep 1 (code=exited, status=0/SUCCESS) Main PID: 2213 (nginx) Tasks: 2 (limit: 24809) Memory: 3M (peak: 4.4M) CPU: 47ms CGroup: /system.slice/openresty.service ├─2213 "nginx: master process /usr/local/openresty/nginx/sbin/nginx" └─2214 "nginx: worker process"
Also Read
How to Install and Configure Nginx Webserver on Oracle Linux 8
Step 2 – Create a Project with OpenResty
In this section, we will create a sample hello world project using OpenResty.
First, create a directory with the following command:
mkdir resty
Next, change the directory to resty and create the other required directories using the following command:
cd resty mkdir logs conf
Next, create an Nginx configuration file:
nano conf/nginx.conf
Add the following code:
worker_processes 1; error_log logs/error.log; events { worker_connections 1024; } http { server { listen 8080; location / { default_type text/html; content_by_lua_block { ngx.say("<p>hello, world</p>") } } } }
Save and close the file, then export the Nginx path with the following command:
PATH=/usr/local/openresty/nginx/sbin:$PATH export PATH
Next, start the Nginx server with the following command:
nginx -p `pwd`/ -c conf/nginx.conf
This will start an Nginx server on port 8080. You can check it with the ss command:
ss -antpl | grep 8080
You will get the following output:
LISTEN 0 128 0.0.0.0:8080 0.0.0.0:* users:(("nginx",pid=8806,fd=8),("nginx",pid=8805,fd=8))
Step 3 – Verify OpenResty Project
You can now verify your OpenResty hello world project using the URL http://your-server-ip:8080. You should see the following page:
You can also use the curl command to test your project:
curl http://localhost:8080/
You will get the following output:
hello, world
Conclusion
In the above guide, we explained how to install OpenResty on Rocky Linux 10. We also created a sample hello world project and host it using OpenResty. Start working on the OpenResty platform today on dedicated hosts from Atlantic.Net!