(OpenWrt Wiki) LuCI Essentials

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

15/9/21 11:40 [OpenWrt Wiki] LuCI essentials

You are here /  /  Documentation /  User guide /  LuCI web interface /  LuCI essentials

LuCI essentials
This article relies on the following:

Accessing OpenWrt CLI


Managing configurations
Managing packages
Managing services

Introduction
While OpenWrt can be managed completely using SSH () and the terminal, the LuCI WebUI
makes many administration tasks easier.
The OpenWrt full releases, such as the current
18.06.x series, ship with the LuCI WebUI installed.
But for lower-memory devices, such as
those with 4MBytes Flash and/or 32MBytes of RAM, the full install may fail because of
lacking sufficient Flash memory so you will have to build your own image with LuCI included.
More info on this can be obtained here.

Instructions

1. Basic installation
Connect to your router via SSH () and install the packages.

opkg update

opkg install luci

Now you can open LuCI interface.

2. Providing encryption
Connect to your router via SSH () and install the packages.

opkg update

opkg install luci-ssl

/etc/init.d/uhttpd restart

Reload LuCI interface and verify that you are using HTTPS ().

https://openwrt.org/docs/guide-user/luci/luci.essentials 1/6
15/9/21 11:40 [OpenWrt Wiki] LuCI essentials

3. Native language support


LuCI uses English by default.
You can search and install additional packages for native
language support.

opkg update

opkg list luci-i18n-\*

opkg install luci-i18n-hungarian

You can also install multiple language packs and switch between them in the LuCI settings.

LuCI is being actively translated (https://github.com/openwrt/luci/wiki/i18n) into many


languages by volunteers.

4. Additional web applications


Search and install luci-app-* packages if you want to configure services via LuCI.

opkg update

opkg list luci-app-\*

5. Alternative ports
Use alternative ports:

HTTP () - 8080/TCP ()
HTTPS () - 8443/TCP ()

uci -q delete uhttpd.main.listen_http

uci add_list uhttpd.main.listen_http="0.0.0.0:8080"

uci add_list uhttpd.main.listen_http="[::]:8080"

uci -q delete uhttpd.main.listen_https

uci add_list uhttpd.main.listen_https="0.0.0.0:8443"

uci add_list uhttpd.main.listen_https="[::]:8443"

uci commit uhttpd


/etc/init.d/uhttpd restart

Extras

Details
LuCI is installed as a 'meta package' which installs several other packages by having these
defined as a dependency.
Notably, it installs the uHTTPd web server, configured for use with
LuCI.

In case you want to use uHTTPd, there is little configuration necessary as uHTTPd is
configured with CGI to make LuCI work with the Lua interpreter.
By default this is organised
as follows.
By default /www is the standard document root.
Thus, by requesting this docroot
https://openwrt.org/docs/guide-user/luci/luci.essentials 2/6
15/9/21 11:40 [OpenWrt Wiki] LuCI essentials

(by pointing your browser to the devices IP () address) an index file such as index.html is
searched for (per uHTTPd settings).
The file /www/index.html (installed with LuCI) is
prepared such that when requested, it redirects you to /cgi-bin/luci , which is the default
CGI gateway for LuCI.
This is just a script, which basically calls Lua at /usr/bin/lua .
uhttpd
is configured by default to load pages as CGI in the /cgi-bin path, and thus starts serving
these pages with the /cgi-bin/luci script.

It is also possible to run LuCI with Lua as an embedded process.


uhttpd supports this; see
the corresponding section of the uHTTPd Web Server Configuration article on the UCI
configuration of uhttpd.

Configuration
/etc/config/uhttpd
/etc/config/luci

LuCI on other web servers


webserver

LuCI on lighttpd
luci.on.lighttpd

LuCI on nginx
For routers without significant space constraints running on snapshots/master or v19 or later,
it is possible to install using nginx.
LuCI on nginx is currently supported by using uwsgi as
plain-cgi interpreter.
You need to install one of this 2 variants of the LuCI meta-package:

luci-nginx - Autoinstall nginx, uwsgi-cgi and the default config file to make luci work on
nginx.
luci-ssl-nginx - Autoinstall nginx-ssl, uwsgi-cgi and the default config file to make luci
wok on nginx.

It does also create a self-signed certificate for nginx and redirect http traffic to https by
default.
Note that even when using nginx, exposing the LuCI interface to the Internet or
guest networks is not recommended.

Currently LuCI on nginx is fully supported (maybe only in master snapshots for now, as of
16-Feb-2019).
If any problem is found, report them to the support forum
(https://forum.openwrt.org/t/luci-on-nginx-compile/14580).

LuCI on BusyBox httpd


If you have a very limited space then you can compile OpenWRT image with BusyBox httpd
instead of uhttpd. LUCI works fine but you'll need some manual configuration. Also this setup
is not widely used and tested.
If any problem is found, report them to the support forum
(https://forum.openwrt.org/t/luci-on-busybox-httpd/84418).

Offline installation

https://openwrt.org/docs/guide-user/luci/luci.essentials 3/6
15/9/21 11:40 [OpenWrt Wiki] LuCI essentials

Download the following packages from the package repository


(https://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/packages/) using
your platform and release version:

Basic
liblua
libubus
libubus-lua
libuci-lua
lua
luci-base
luci-lib-ip
luci-lib-jsonc
luci-lib-nixio
luci-mod-admin-full
luci-theme-bootstrap
rpcd
uhttpd

Extended
luci
luci-app-firewall
luci-app-opkg
luci-proto-ipv6
luci-proto-ppp

Transfer the downloaded packages to your router onto the RAM disk and install them.

# Upload packages to the router

ssh root@openwrt.lan mkdir -p /tmp/luci-offline

scp *.ipk root@openwrt.lan:/tmp/luci-offline

# Install packages

ssh root@openwrt.lan opkg install /tmp/luci-offline/*.ipk

# Clean up

ssh root@openwrt.lan rm -f -R /tmp/luci-offline

Or use this script bellow.


Note, the script assumes you have internet access through the
router where you are installing LuCI.
If you do not, then you will need to either manually
download required .ipk packages, or run the script in two parts.
First part till the last done
statement to be executed when connected to the internet:

https://openwrt.org/docs/guide-user/luci/luci.essentials 4/6
15/9/21 11:40 [OpenWrt Wiki] LuCI essentials

#!/bin/sh

# Exit on error

set -e

# Configuration parameters

OWRT_USER="root"

OWRT_HOST="openwrt.lan"

OWRT_TEMP="/tmp/luci-offline"

# Fetch OpenWrt release

eval $(ssh openwrt cat /etc/openwrt_release)

if [ "${DISTRIB_RELEASE}" = "SNAPSHOT" ]

then OWRT_DIR="snapshots"

else OWRT_DIR="releases/${DISTRIB_RELEASE}"

fi

# LuCI packages and repos

OWRT_URL="https://downloads.openwrt.org"

OWRT_CORE="libiwinfo libiwinfo-lua"

OWRT_COREURL="${OWRT_URL}/${OWRT_DIR}/targets/${DISTRIB_TARGET}/packages"

OWRT_BASE="libjson-c2 liblua lua libuci-lua libubus libubus-lua uhttpd rpcd"

OWRT_BASEURL="${OWRT_URL}/${OWRT_DIR}/packages/${DISTRIB_ARCH}/base"

OWRT_LUCI="luci-base liblucihttp liblucihttp-lua luci-lib-ip luci-lib-nixio \

luci-theme-bootstrap luci-mod-admin-full luci-lib-jsonc luci-mod-status \

luci-mod-system luci-mod-network"

OWRT_LUCIURL="${OWRT_URL}/${OWRT_DIR}/packages/${DISTRIB_ARCH}/luci"

# Download packages from repos

mkdir -p "${OWRT_TEMP}"

for OWRT_REPO in OWRT_CORE OWRT_BASE OWRT_LUCI

do

OWRT_REPOURL=$(eval echo '${'${OWRT_REPO}'URL}')

wget -N -P "${OWRT_TEMP}/${OWRT_REPOURL##*/}" "${OWRT_REPOURL}/Packages"

for OWRT_PKG in $(eval echo '${'${OWRT_REPO}'}')

do

OWRT_PKGFILE="$(sed -n -r -e \

"/^Filename:\s${OWRT_PKG}[.0-9]*_.+\.ipk/s/^.*\s//p" \

"${OWRT_TEMP}/${OWRT_REPOURL##*/}/Packages")"

OWRT_PKGURL="${OWRT_REPOURL}/${OWRT_PKGFILE}"

wget -N -P "${OWRT_TEMP}" "${OWRT_PKGURL}"

done

done

# Upload packages to OpenWrt

ssh "${OWRT_USER}@${OWRT_HOST}" "mkdir -p ${OWRT_TEMP}"

scp "${OWRT_TEMP}/"*.ipk "${OWRT_USER}@${OWRT_HOST}:${OWRT_TEMP}"


ssh "${OWRT_USER}@${OWRT_HOST}" "opkg install ${OWRT_TEMP}/*.ipk"

ssh "${OWRT_USER}@${OWRT_HOST}" "rm -f -R ${OWRT_TEMP}"

rm -f -R "${OWRT_TEMP}"

References
LuCI is developed at GitHub (https://github.com/openwrt/luci)
LuCI issue tracker (https://github.com/openwrt/luci/issues)
https://openwrt.org/docs/guide-user/luci/luci.essentials 5/6
15/9/21 11:40 [OpenWrt Wiki] LuCI essentials

LuCI documentation wiki (https://github.com/openwrt/luci/wiki)


Secure access to LuCI via SSH tunnel
LuCI technical reference

Last modified: 2021/03/04 22:20 by vgaetera

Self-registration in the wiki has been disabled.

If you want to contribute to the OpenWrt wiki, please post HERE (https://forum.openwrt.org/t/applying-for-
openwrt-wiki-account/101671) in the forum or ask on IRC () for access.

Except where otherwise noted, content on this wiki is licensed under the following license:

CC Attribution-Share Alike 4.0 International

https://openwrt.org/docs/guide-user/luci/luci.essentials 6/6

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy