Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:luci:luci.essentials [2019/04/28 13:44] – stylistics vgaeteradocs:guide-user:luci:luci.essentials [2023/04/03 01:00] – [Offline installation] vgaetera
Line 1: Line 1:
 ====== LuCI essentials ====== ====== LuCI essentials ======
-{{section>meta:infobox:howto_links#cli_skills&noheader&nofooter&noeditbutton}}+{{section>meta:infobox:howto_links#basic_skills&noheader&nofooter&noeditbutton}}
  
 ===== 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 18.06.x series, ship with the LuCI WebUI installed.+The OpenWrt full releases, such as the current 21.02.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 [[docs:guide-user:additional-software:imagebuilder|build your own image]] with LuCI included. 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:guide-user:additional-software:imagebuilder|build your own image]] with LuCI included.
 More info on this can be obtained [[docs:guide-user:additional-software:saving_space|here]]. More info on this can be obtained [[docs:guide-user:additional-software:saving_space|here]].
Line 10: Line 10:
 ===== Instructions ===== ===== Instructions =====
 ==== 1. Basic installation ==== ==== 1. Basic installation ====
-Connect to your router via SSH and install the packages.+Install the required packages.
  
 <code bash> <code bash>
Line 17: Line 17:
 </code> </code>
  
-Now you can open **[[http://openwrt.lan/|LuCI]]** interface.+Now you can open LuCI interface.
  
 ==== 2. Providing encryption ==== ==== 2. Providing encryption ====
-Connect to your router via SSH and install the packages.+Install the required packages.
  
 <code bash> <code bash>
 opkg update opkg update
-opkg install luci-ssl-openssl+opkg install luci-ssl 
 +/etc/init.d/uhttpd restart
 </code> </code>
  
-Reload **[[http://openwrt.lan/|LuCI]]** interface and verify that you are using HTTPS.+Reload LuCI interface and verify that you are using HTTPS.
  
 ==== 3. Native language support ==== ==== 3. Native language support ====
Line 43: Line 44:
 LuCI is being actively [[https://github.com/openwrt/luci/wiki/i18n|translated]] into many languages by volunteers. LuCI is being actively [[https://github.com/openwrt/luci/wiki/i18n|translated]] into many languages by volunteers.
  
-==== 4. Additional WebApps ====+==== 4. Additional web applications ====
 Search and install ''luci-app-*'' packages if you want to configure services via LuCI. Search and install ''luci-app-*'' packages if you want to configure services via LuCI.
  
Line 49: Line 50:
 opkg update opkg update
 opkg list luci-app-\* opkg list luci-app-\*
 +</code>
 +
 +==== 5. Alternative ports ====
 +Use alternative ports:
 +  * HTTP - 8080/TCP
 +  * HTTPS - 8443/TCP
 +
 +<code bash>
 +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
 </code> </code>
  
Line 67: Line 84:
 uhttpd supports this; see the corresponding section of the [[docs:guide-user:services:webserver:uhttpd#embedded_lua|uHTTPd Web Server Configuration]] article on the UCI configuration of uhttpd. uhttpd supports this; see the corresponding section of the [[docs:guide-user:services:webserver:uhttpd#embedded_lua|uHTTPd Web Server Configuration]] article on the UCI configuration of uhttpd.
  
 +LuCI by default comes with the bootstrap theme. There are additional themes available and you can create your own if you wish - [[:docs:guide-user:luci:luci.themes]]
 ==== Configuration ==== ==== Configuration ====
   * ''[[docs:guide-user:services:webserver:uhttpd|/etc/config/uhttpd]]''   * ''[[docs:guide-user:services:webserver:uhttpd|/etc/config/uhttpd]]''
Line 78: Line 96:
  
 === LuCI on nginx === === 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. 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 - Autoinstall nginx, uwsgi-cgi and the default config file to make luci work on nginx +  * [[packages:pkgdata: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. +  * [[packages:pkgdata: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+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). 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.+If any problem is found, report them to the [[https://forum.openwrt.org/t/luci-on-nginx-compile/14580|support forum]].
  
-  * [[https://forum.openwrt.org/t/luci-on-nginx-compile/14580|Support forum for LuCI on Nginx]]+=== LuCI on BusyBox httpd === 
 +If you have a very limited space then you can compile OpenWRT image with [[docs:guide-user:services:webserver:http.httpd|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 [[https://forum.openwrt.org/t/luci-on-busybox-httpd/84418|support forum]].
  
 ==== Offline installation ==== ==== Offline installation ====
 Download the following packages from the [[https://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/packages/|package repository]] using your platform and release version: Download the following packages from the [[https://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/packages/|package repository]] using your platform and release version:
-  * luci 
-  * luci-app-firewall 
-  * luci-i18n-english 
-  * luci-lib-core 
-  * luci-lib-ipkg 
-  * luci-lib-nixio 
-  * luci-lib-sys 
-  * luci-lib-web 
-  * luci-mod-admin-core 
-  * luci-mod-admin-full 
-  * luci-proto-core 
-  * luci-proto-ppp 
-  * luci-sgi-cgi 
-  * luci-theme-base 
-  * luci-theme-openwrt 
  
-<code bash> +=== Basic === 
-# Upload the packages to the router +  [[packages:pkgdata:liblua5.1.5|liblua]] 
-scp *.ipk root@openwrt.lan:/tmp+  * [[packages:pkgdata:libubus20220601|libubus]] 
 +  * [[packages:pkgdata:libubus-lua]] 
 +  * [[packages:pkgdata:libuci-lua]] 
 +  * [[packages:pkgdata:lua]] 
 +  * [[packages:pkgdata:luci-base]] 
 +  * [[packages:pkgdata:luci-lib-ip]] 
 +  * [[packages:pkgdata:luci-lib-jsonc]] 
 +  * [[packages:pkgdata:luci-lib-nixio]] 
 +  * [[packages:pkgdata:luci-mod-admin-full]] 
 +  * [[packages:pkgdata:luci-theme-bootstrap]] 
 +  * [[packages:pkgdata:rpcd]] 
 +  * [[packages:pkgdata:uhttpd]]
  
-# Log into the router +=== Extended === 
-ssh root@openwrt.lan+  * [[packages:pkgdata:luci]] 
 +  * [[packages:pkgdata:luci-app-firewall]] 
 +  * [[packages:pkgdata:luci-app-opkg]] 
 +  * [[packages:pkgdata:luci-proto-ipv6]] 
 +  * [[packages:pkgdata:luci-proto-ppp]]
  
-# Installed the packages +Transfer the downloaded packages to your router onto the RAM disk and install them.
-opkg install /tmp/*.ipk +
- +
-# Clean up +
-rm -f /tmp/*.ipk +
-</code> +
- +
-==== Minimalistic offline installation ==== +
-You can also install a minimal version of LuCI with following packages selected for installation. +
-Download and transfer the packages to your OpenWrt router onto the RAM disk in ''/tmp/luci-offline-packages''+
  
 <code bash> <code bash>
-mkdir -p /tmp/luci-offline-packages; cd /tmp/luci-offline-packages +# Upload packages to the router 
-</code>+ssh root@openwrt.lan mkdir -p /tmp/luci-offline 
 +scp *.ipk root@openwrt.lan:/tmp/luci-offline
  
-  * liblua  +# Install packages 
-  * lua  +ssh root@openwrt.lan opkg install /tmp/luci-offline/*.ipk
-  * libuci-lua +
-  * libubus  +
-  * libubus-lua +
-  * uhttpd +
-  * rpcd +
-  * luci-base +
-  luci-lib-ip +
-  * luci-lib-nixio +
-  * luci-theme-bootstrap +
-  * luci-mod-admin-full +
-  * luci-lib-jsonc+
  
-and install them with: +# Clean up 
- +ssh root@openwrt.lan rm -f -R /tmp/luci-offline
-<code bash> +
-opkg install /tmp/luci-offline-packages/*.ipk; done+
 </code> </code>
  
 Or use this script bellow. Or use this script bellow.
-Note, the script assumes you have internet access through the router where you are installing Luci+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. +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.:+First part till the last ''done'' statement to be executed when connected to the internet:
  
 <code bash> <code bash>
 #!/bin/sh #!/bin/sh
-#assumes the user has egrep, wget, ssh, and scp 
  
 +# Exit on error
 set -e set -e
  
-Change this to match your router +Configuration parameters 
-architecture="brcm63xx"+OWRT_USER="root" 
 +OWRT_HOST="openwrt.lan" 
 +OWRT_TEMP="/tmp/luci-offline"
  
-These should be fine unless you've changed something +Fetch OpenWrt release 
-user="root" +eval $(ssh "${OWRT_HOST}cat /etc/os-release)
-ip_address="openwrt.lan"+
  
-url="https://downloads.openwrt.org/snapshots/packages/${architecture}" +# LuCI packages and repos 
-tmpdir="/tmp/luci-offline+case "${VERSION_ID}" in 
-base="liblua lua libuci-lua libubus libubus-lua uhttpd rpcd" +(snapshot) OWRT_URL="https://downloads.${HOME_URL#*//}snapshots/" ;; 
-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 libiwinfo-lua libiwinfo-lua"+(*) OWRT_URL="https://downloads.${HOME_URL#*//}releases/${VERSION_ID}/;; 
 +esac 
 +OWRT_CORE="libiwinfo libiwinfo-lua" 
 +OWRT_COREURL="${OWRT_URL}targets/${OPENWRT_BOARD}/packages
 +OWRT_BASE="libjson-c2 liblua lua libuci-lua libubus libubus-lua uhttpd rpcd" 
 +OWRT_BASEURL="${OWRT_URL}packages/${OPENWRT_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}packages/${OPENWRT_ARCH}/luci"
  
-mkdir -p "${tmpdir}" +# Download packages from repos 
- +mkdir -p "${OWRT_TEMP}" 
-for pkgdir in base luci; do +for OWRT_REPO in OWRT_CORE OWRT_BASE OWRT_LUCI 
-    wget -N -P "${tmpdir}" --quiet "${url}/${pkgdir}/Packages" +do 
-    for pkg in $(eval echo '${'${pkgdir}'}')do +    OWRT_REPOURL=$(eval echo '${'${OWRT_REPO}'URL}') 
-        pkgfile="$(egrep --e " ${pkg}_.+" "${tmpdir}/Packages" | tail -c +2)" +    wget -N -P "${OWRT_TEMP}/${OWRT_REPOURL##*/}" "${OWRT_REPOURL}/Packages" 
-        pkgurl="${url}/${pkgdir}/${pkgfile}" +    for OWRT_PKG in $(eval echo '${'${OWRT_REPO}'}') 
-        wget -N -P "${tmpdir}" --quiet "${pkgurl}"+    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
 done done
  
-ssh "${user}@${ip_address}" mkdir -p "${tmpdir}" +# Upload packages to OpenWrt 
-scp *.ipk "${user}@${ip_address}:${tmpdir}" +ssh "${OWRT_USER}@${OWRT_HOST}"mkdir -p ${OWRT_TEMP}" 
-ssh "${user}@${ip_address}" opkg install "${tmpdir}"/*.ipk +scp "${OWRT_TEMP}/"*.ipk "${OWRT_USER}@${OWRT_HOST}:${OWRT_TEMP}" 
-ssh "${user}@${ip_address}" rm -r -f "${tmpdir}" +ssh "${OWRT_USER}@${OWRT_HOST}"opkg install ${OWRT_TEMP}/*.ipk" 
- +ssh "${OWRT_USER}@${OWRT_HOST}"rm -f -R ${OWRT_TEMP}" 
-rm -r -f "${tmpdir}"+rm -f -R "${OWRT_TEMP}"
 </code> </code>
  
-==== Additional links ==== +==== References ==== 
-  * [[https://github.com/openwrt/luci|LuCI is developed at Github]]+  * [[https://github.com/openwrt/luci|LuCI is developed at GitHub]]
   * [[https://github.com/openwrt/luci/issues|LuCI issue tracker]]   * [[https://github.com/openwrt/luci/issues|LuCI issue tracker]]
-  * [[http://luci.subsignal.org|LuCI legacy website]] +  * [[https://github.com/openwrt/luci/wiki|LuCI documentation wiki]] 
-  * [[docs:guide-user:luci:luci.secure|Secure access to LuCI via SSH-tunnel]] +  * [[docs:guide-user:luci:luci.secure|Secure access to LuCI via SSH tunnel]] 
-  * [[docs:techref:luci|LuCI Technical Reference]]+  * [[docs:techref:luci|LuCI technical reference]] 
 +  * [[docs:guide-user:luci:luci.themes|LuCI Themes and how to change them]]
  
  • Last modified: 2024/10/27 22:35
  • by palebloodsky