Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:luci:luci.essentials [2019/03/25 13:35] – [LuCI] Added introduction header vgaetera | docs:guide-user:luci:luci.essentials [2023/04/03 01:00] – [Offline installation] vgaetera | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== LuCI ====== | + | ====== LuCI essentials |
| - | + | {{section>meta:infobox:howto_links# | |
| - | <WRAP info> | + | |
| - | This article relies on the following skills: | + | |
| - | * [[docs:guide-user: | + | |
| - | * [[docs: | + | |
| - | * [[docs: | + | |
| - | </ | + | |
| ===== Introduction ===== | ===== Introduction ===== | ||
| While OpenWrt can be managed completely using SSH and the terminal, the LuCI WebUI makes many administration tasks easier. | 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 | + | The OpenWrt full releases, such as the current |
| 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 [[docs: | 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 [[docs: | ||
| More info on this can be obtained [[docs: | More info on this can be obtained [[docs: | ||
| - | ===== Online Installation | + | ===== Instructions |
| - | ==== Basic Installation | + | ==== 1. Basic installation |
| - | Connect to your router via SSH and install | + | Install |
| <code bash> | <code bash> | ||
| Line 23: | Line 17: | ||
| </ | </ | ||
| - | Now you can open // | + | Now you can open LuCI interface. |
| - | ==== Providing | + | ==== 2. Providing |
| - | Connect to your router via SSH and install | + | Install |
| <code bash> | <code bash> | ||
| opkg update | opkg update | ||
| - | opkg install luci-ssl-openssl | + | opkg install luci-ssl |
| + | / | ||
| </ | </ | ||
| - | Reload | + | Reload LuCI interface and verify that you are using HTTPS. |
| - | ==== Native | + | ==== 3. Native |
| LuCI uses English by default. | LuCI uses English by default. | ||
| You can search and install additional packages for native language support. | You can search and install additional packages for native language support. | ||
| Line 45: | Line 40: | ||
| </ | </ | ||
| - | You can also install multiple language packs and switch between them in the LuCI settings | + | You can also install multiple language packs and switch between them in the LuCI settings. |
| - | LuCI is being actively | + | LuCI is being actively [[https:// |
| - | See [[https:// | + | |
| - | ==== Additional | + | ==== 4. Additional |
| Search and install '' | Search and install '' | ||
| Line 58: | Line 52: | ||
| </ | </ | ||
| - | ==== Details | + | ==== 5. Alternative ports ==== |
| - | LuCI is installed as a 'meta package' | + | Use alternative ports: |
| + | * HTTP - 8080/TCP | ||
| + | * HTTPS - 8443/TCP | ||
| - | * uhttpd | + | <code bash> |
| - | | + | uci -q delete |
| - | | + | uci add_list |
| - | | + | uci add_list uhttpd.main.listen_http=" |
| - | | + | uci -q delete uhttpd.main.listen_https |
| - | | + | uci add_list uhttpd.main.listen_https=" |
| - | | + | uci add_list uhttpd.main.listen_https=" |
| - | | + | uci commit uhttpd |
| + | / | ||
| + | </ | ||
| + | |||
| + | ===== Extras ===== | ||
| + | ==== Details ==== | ||
| + | LuCI is installed as a 'meta package' | ||
| + | Notably, it installs the [[docs: | ||
| - | 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 ''/ | + | 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 ''/ | ||
| + | Thus, by requesting this docroot (by pointing your browser to the devices IP address) an index file such as '' | ||
| + | The file ''/ | ||
| + | This is just a script, which basically calls Lua at ''/ | ||
| + | uhttpd is configured by default to load pages as CGI in the ''/ | ||
| - | It is also possible to run LuCI with Lua as an embedded process. uhttpd supports this; see the corresponding section of the [[docs: | + | It is also possible to run LuCI with Lua as an embedded process. |
| + | uhttpd supports this; see the corresponding section of the [[docs: | ||
| + | LuCI by default comes with the bootstrap theme. There are additional themes available and you can create your own if you wish - [[: | ||
| ==== Configuration ==== | ==== Configuration ==== | ||
| - | The default web server software uhttpd is configured in the file '' | + | * '' |
| - | The LuCI WebUI is configured in the file '' | + | |
| - | ===== LuCI on other web servers | + | ==== LuCI on other web servers ==== |
| - | ->[[docs: | + | [[docs: |
| - | ==== LuCI on lighttpd | + | === LuCI on lighttpd === |
| - | ->[[docs: | + | [[docs: |
| - | ==== LuCI on nginx ==== | + | === LuCI on nginx === |
| - | LuCI on nginx is currently supported by using uwsgi as plain-cgi interpreter. | + | For routers without significant space constraints running on snapshots/ |
| + | 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: | You need to install one of this 2 variants of the LuCI meta-package: | ||
| - | * luci-nginx | + | * [[packages: |
| - | * luci-nginx-ssl -- 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 | + | * [[packages: |
| + | 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. | + | 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 [[https:// | ||
| - | * [[https:// | + | === LuCI on BusyBox httpd === |
| + | If you have a very limited space then you can compile OpenWRT image with [[docs: | ||
| + | If any problem is found, report them to the [[https:// | ||
| - | ===== Offline installation | + | ==== Offline installation ==== |
| - | - Go to the package download page of the distribution in question: (for ar71xx - generic " | + | Download |
| - | - Download the following packages: **(The extension " * " will show package | + | |
| - | * luci_*.ipk | + | |
| - | * luci-app-firewall_*.ipk | + | |
| - | * luci-i18n-english_*.ipk | + | |
| - | * luci-lib-core_*.ipk | + | |
| - | * luci-lib-ipkg_*.ipk | + | |
| - | * luci-lib-nixio_*.ipk | + | |
| - | * luci-lib-sys_*.ipk | + | |
| - | * luci-lib-web_*.ipk | + | |
| - | * luci-mod-admin-core_*.ipk | + | |
| - | * luci-mod-admin-full_*.ipk | + | |
| - | * luci-proto-core_*.ipk | + | |
| - | * luci-proto-ppp_*.ipk | + | |
| - | * luci-sgi-cgi_*.ipk | + | |
| - | * luci-theme-base_*.ipk | + | |
| - | * luci-theme-openwrt_*.ipk | + | |
| - | - Connect the router to the computer and copy the packages to the router using file transfer. For example the following command can be used via the command prompt in windows 10:\\ < | + | |
| - | scp luci_0.11.1-1_ar71xx.ipk luci-app-firewall_0.11.1-1_ar71xx.ipk luci-i18n-english_0.11.1-1_ar71xx.ipk luci-lib-core_0.11.1-1_ar71xx.ipk luci-lib-ipkg_0.11.1-1_ar71xx.ipk luci-lib-nixio_0.11.1-1_ar71xx.ipk luci-lib-sys_0.11.1-1_ar71xx.ipk luci-lib-web_0.11.1-1_ar71xx.ipk luci-mod-admin-core_0.11.1-1_ar71xx.ipk luci-mod-admin-full_0.11.1-1_ar71xx.ipk luci-proto-core_0.11.1-1_ar71xx.ipk luci-proto-ppp_0.11.1-1_ar71xx.ipk luci-sgi-cgi_0.11.1-1_ar71xx.ipk luci-theme-base_0.11.1-1_ar71xx.ipk luci-theme-openwrt_0.11.1-1_ar71xx.ipk | + | |
| - | </ | + | |
| - | - Log into the router. For example by entering the following command into command prompt in windows 10 \\ < | + | |
| - | ssh root@openwrt.lan | + | |
| - | </ | + | |
| - | - Packages can be installed using the following command \\ < | + | |
| - | opkg install PACKAGE_NAME | + | |
| - | </ | + | |
| - | - Install the packages in the following order | + | |
| - | * luci-proto-core_0.11.1-1_ar71xx.ipk | + | |
| - | * luci-lib-core_0.11.1-1_ar71xx.ipk | + | |
| - | * luci-lib-sys_0.11.1-1_ar71xx.ipk | + | |
| - | * luci-lib-nixio_0.11.1-1_ar71xx.ipk | + | |
| - | * luci-sgi-cgi_0.11.1-1_ar71xx.ipk | + | |
| - | * luci-lib-web_0.11.1-1_ar71xx.ipk | + | |
| - | * luci-i18n-english_0.11.1-1_ar71xx.ipk | + | |
| - | * luci-mod-admin-core_0.11.1-1_ar71xx.ipk | + | |
| - | * luci-lib-ipkg_0.11.1-1_ar71xx.ipk | + | |
| - | * luci-mod-admin-full_0.11.1-1_ar71xx.ipk | + | |
| - | * luci-theme-base_0.11.1-1_ar71xx.ipk | + | |
| - | * luci-theme-openwrt_0.11.1-1_ar71xx.ipk | + | |
| - | * luci-app-firewall_0.11.1-1_ar71xx.ipk | + | |
| - | * luci-proto-ppp_0.11.1-1_ar71xx.ipk | + | |
| - | * luci_0.11.1-1_ar71xx.ipk | + | |
| - | - The LuCI WebUI will be available at %%http:// | + | |
| - | - To clean up, remove the packages with the following command \\ < | + | |
| - | rm luci_0.11.1-1_ar71xx.ipk luci-app-firewall_0.11.1-1_ar71xx.ipk luci-i18n-english_0.11.1-1_ar71xx.ipk luci-lib-core_0.11.1-1_ar71xx.ipk luci-lib-ipkg_0.11.1-1_ar71xx.ipk luci-lib-nixio_0.11.1-1_ar71xx.ipk luci-lib-sys_0.11.1-1_ar71xx.ipk luci-lib-web_0.11.1-1_ar71xx.ipk luci-mod-admin-core_0.11.1-1_ar71xx.ipk luci-mod-admin-full_0.11.1-1_ar71xx.ipk luci-proto-core_0.11.1-1_ar71xx.ipk luci-proto-ppp_0.11.1-1_ar71xx.ipk luci-sgi-cgi_0.11.1-1_ar71xx.ipk luci-theme-base_0.11.1-1_ar71xx.ipk luci-theme-openwrt_0.11.1-1_ar71xx.ipk | + | |
| - | </ | + | |
| - | ==== Minimalistic offline installation ==== | + | === Basic === |
| - | You can also install a minimal version of LuCI with following | + | * [[packages: |
| - | Download and transfer the packages | + | * [[packages: |
| - | < | + | * [[packages: |
| + | * [[packages: | ||
| + | * [[packages: | ||
| + | * [[packages:pkgdata:luci-base]] | ||
| + | * [[packages: | ||
| + | * [[packages: | ||
| + | * [[packages: | ||
| + | * [[packages: | ||
| + | * [[packages:pkgdata:luci-theme-bootstrap]] | ||
| + | * [[packages: | ||
| + | * [[packages: | ||
| - | * liblua | + | === Extended === |
| - | * lua | + | * [[packages: |
| - | * libuci-lua | + | * [[packages: |
| - | * libubus | + | * [[packages: |
| - | * libubus-lua | + | * [[packages: |
| - | * uhttpd | + | * [[packages: |
| - | * rpcd | + | |
| - | * luci-base | + | |
| - | * luci-lib-ip | + | |
| - | * luci-lib-nixio | + | |
| - | * luci-theme-bootstrap | + | |
| - | * luci-mod-admin-full | + | |
| - | * luci-lib-jsonc | + | |
| - | and install them with: | + | Transfer the downloaded packages to your router onto the RAM disk and install them. |
| - | <code bash>opkg install | + | <code bash> |
| + | # Upload packages to the router | ||
| + | ssh root@openwrt.lan mkdir -p / | ||
| + | scp *.ipk root@openwrt.lan: | ||
| - | 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 Internet.: | + | # Install |
| - | <code bash>#!/bin/sh | + | ssh root@openwrt.lan opkg install |
| - | #assumes the user has egrep, wget, ssh, and scp | + | |
| - | set -e | + | # Clean up |
| + | ssh root@openwrt.lan rm -f -R / | ||
| + | </ | ||
| - | # Change | + | Or use this script bellow. |
| - | architecture=" | + | Note, the script assumes you have internet access through the router |
| + | If you do not, then you will need to either manually download required '' | ||
| + | First part till the last '' | ||
| - | # These should be fine unless you've changed something | + | <code bash> |
| - | user=" | + | #!/bin/sh |
| - | ip_address=" | + | |
| - | url=" | + | # Exit on error |
| - | tmpdir="/ | + | set -e |
| - | packages_base=" | + | |
| - | packages_luci=" | + | |
| - | mkdir "$tmpdir" | + | # Configuration parameters |
| - | cd "$tmpdir" | + | OWRT_USER=" |
| + | OWRT_HOST="openwrt.lan" | ||
| + | OWRT_TEMP="/ | ||
| - | wget -N --quiet " | + | # Fetch OpenWrt release |
| - | for pkg in $packages_base; | + | eval $(ssh "${OWRT_HOST}" |
| - | pkgfile=" | + | |
| - | pkgurl=" | + | |
| - | wget -N --quiet " | + | |
| - | done | + | |
| - | wget -N --quiet | + | # LuCI packages and repos |
| - | for pkg in $packages_luci; do | + | case "${VERSION_ID}" in |
| - | | + | (snapshot) OWRT_URL=" |
| - | | + | (*) OWRT_URL="https:// |
| - | | + | esac |
| - | done | + | OWRT_CORE=" |
| + | OWRT_COREURL="${OWRT_URL}targets/ | ||
| + | OWRT_BASE=" | ||
| + | OWRT_BASEURL="${OWRT_URL}packages/${OPENWRT_ARCH}/base" | ||
| + | OWRT_LUCI=" | ||
| + | | ||
| + | luci-mod-system luci-mod-network" | ||
| + | OWRT_LUCIURL="${OWRT_URL}packages/ | ||
| - | wget -N --quiet | + | # Download packages from repos |
| - | for pkg in $packages_luci; | + | mkdir -p " |
| - | | + | for OWRT_REPO in OWRT_CORE OWRT_BASE OWRT_LUCI |
| - | | + | do |
| - | wget -N --quiet | + | OWRT_REPOURL=$(eval echo ' |
| + | | ||
| + | for OWRT_PKG | ||
| + | | ||
| + | OWRT_PKGFILE="$(sed -n -r -e \ | ||
| + | | ||
| + | " | ||
| + | | ||
| + | wget -N -P "${OWRT_TEMP}" | ||
| + | done | ||
| done | done | ||
| - | ssh "${user}@${ip_address}" mkdir -p / | + | # Upload packages to OpenWrt |
| - | scp *.ipk "${user}@${ip_address}":/ | + | ssh "${OWRT_USER}@${OWRT_HOST}" |
| - | ssh "${user}@${ip_address}" opkg install | + | scp " |
| - | ssh "${user}@${ip_address}" rm -rf /tmp/luci-offline-packages/ | + | ssh "${OWRT_USER}@${OWRT_HOST}" |
| - | + | ssh "${OWRT_USER}@${OWRT_HOST}" | |
| - | ssh "${user}@${ip_address}" | + | rm -f -R "${OWRT_TEMP}" |
| - | ssh "${user}@${ip_address}" | + | </ |
| - | + | ||
| - | cd | + | |
| - | rm -rf " | + | |
| - | + | ||
| - | ===== Miscellaneous ===== | + | |
| - | ==== Secure acccess to luci webserver ==== | + | |
| - | If you want to configure Luci webserver for secure access, [[docs: | + | |
| - | + | ||
| - | ===== Troubleshooting ===== | + | |
| - | * LuCI is developed at Github: | + | |
| - | * Please file LuCI specific bugs at the [[https:// | + | |
| - | * LuCIs old web-presence at [[http:// | + | |
| - | ===== Notes ===== | + | ==== References |
| - | [[docs: | + | * [[https:// |
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[docs: | ||
| + | * [[docs: | ||
| + | * [[docs: | ||