
To set up OpenWrt LuCI HTTPS through the command line, you'll need to generate a certificate and key using OpenSSL.
First, you'll need to create a certificate and key using OpenSSL with the following command: `openssl req -x509 -newkey rsa:4096 -nodes -keyout luci.key -out luci.crt -days 365 -subj "/C=US/ST=State/L=Locality/O=Organization/CN=luci.example.com"`
This command generates a self-signed certificate that is valid for 365 days.
Consider reading: Openssl Command Line
Enabling HTTPS
Enabling HTTPS requires installing the necessary packages and configuring the LuCI web admin interface.
You can connect to OpenWrt via SSH or a USB-TTL cable and terminal program to install the required packages, including luci-ssl and its dependencies. Alternatively, you can access the LuCI interface and navigate to System > Software, update the package lists, and install luci-ssl.
To enable HTTPS, you'll need to install luci-ssl and its dependencies, then reboot your router. You can also use the opkg command to install packages, such as "opkg install luci-ssl" after updating the package lists with "opkg update".
Here's a list of the necessary packages to install:
- luci-ssl
- luci-lib-px5g
- px5g-standalone
- libustream-openssl
- luci
Exporting Required Files
In XCA, click on the Certificates tab. You'll see a list of certificates, so make sure to select the one you want to export.
Right click the SSL certificate and select Export > File. Set the file name to uhttpd.crt and verify the export format is PEM (*.crt).
Click OK and then click on the Private Keys tab. Right click the private key generated for the SSL certificate and select Export > File.
Set the file name to uhttpd.key and verify the export format is PEM private (*.pem). Click OK and then you're done exporting the required files.
Here's a quick recap of the steps:
- In XCA, click on the Certificates tab
- Right click the SSL certificate > Export > File
- Set the file name to uhttpd.crt verify the export format is PEM (*.crt)
- Click OK
- Click the Private Keys tab
- Right click the private key generated for the SSL certificate > Export > File
- Set the file name to uhttpd.key and verify the export format is PEM private (*.pem)
- Click OK
Enabling HTTPS for LuCI Web Admin Interface
You can enable HTTPS for the LuCI web admin interface by installing the luci-ssl package and its dependencies.
To connect to LuCI using HTTPS, you'll need to install the luci-ssl package. You can do this by running the command "opkg install luci-ssl" after updating the package list with "opkg update".
A unique perspective: Openwrt Luci
The luci-ssl package will also grab the required dependencies, and you'll need to reboot your router to apply the changes.
If you're using a web interface, you can install the luci-ssl package by going to System > Software, updating the lists, and then installing the package.
You'll also need to restart the uhttpd service to enable HTTPS.
Once you've installed the luci-ssl package and restarted the service, you can access your router using HTTPS by browsing to the IP address of your router.
Keep in mind that you may get warnings from modern browsers due to the default use of older security algorithms, mainly about SHA1 and the self-signed certificate.
To avoid these warnings, you can use a real key/cert instead of a self-signed one. This would involve generating a key/cert on your Ubuntu host and transferring it to your router in DER format.
Here are the steps to install the luci-ssl package:
1. opkg update
2. opkg install luci-ssl
3. Reboot your router
4. Restart the uhttpd service
Note: Make sure to update your package list before installing the luci-ssl package.
Readers also liked: Openwrt Update Firmware
LuCI Configuration
To enable HTTPS on LuCI, you'll need to install the luci-ssl package and its dependencies. This can be done using the command `opkg install luci-ssl` after updating the package lists with `opkg update`.
The luci-ssl package is not included by default, so you'll need to install it manually. You can do this by navigating to the System>Software page in the LuCI web interface, updating the package lists, and then installing the luci-ssl package.
Alternatively, you can SSH into the router and use the `opkg` command to install the package. This will also grab the required dependencies.
You can find the index URL to browse the packages manually from the OPKG-Configuration page in the LuCI web interface. This can be useful if you're experiencing proxy issues that prevent you from installing the package through the LuCI interface.
To install packages manually, you'll need to use a tool like WinSCP to upload the package files to the router. You can then use the `opkg install` command to install the package, followed by a reboot to apply the changes.
You might like: Openwrt Install Tailscale
Here are the steps to install the luci-ssl package manually:
- Update the package lists with `opkg update`
- Download the luci-ssl package from the package repository
- Upload the package to the router using a tool like WinSCP
- SSH into the router and navigate to the directory where the package was uploaded
- Run the command `opkg install luci-ssl.ipk` to install the package
- Reboot the router to apply the changes
Featured Images: pexels.com


