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 [2020/09/21 17:40] – [Minimalistic offline installation] 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.
- +
-For devices with limited flash or running v18 (or prior, though you should strongly consider upgrading)+
  
 <code bash> <code bash>
 opkg update opkg update
-opkg install luci-ssl-openssl +opkg install luci-ssl 
-</code> +/etc/init.d/uhttpd restart
- +
-For routers without significant space constraints running on snapshots/master or v19 or later, it is possible to install using nginx (a commercial-grade web server) +
- +
-<code bash> +
-opkg update +
-opkg install luci-ssl-nginx+
 </code> </code>
  
 Reload LuCI interface and verify that you are using HTTPS. Reload LuCI interface and verify that you are using HTTPS.
- 
-**//Even when using nginx, exposing the LuCI interface to the Internet or guest networks is not recommended.//** 
  
 ==== 3. Native language support ==== ==== 3. Native language support ====
Line 64: Line 54:
 ==== 5. Alternative ports ==== ==== 5. Alternative ports ====
 Use alternative ports: Use alternative ports:
-  * 8080/TCP - HTTP +  * HTTP - 8080/TCP 
-  * 8443/TCP - HTTPS+  * HTTPS - 8443/TCP
  
 <code bash> <code bash>
Line 94: 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 105: 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+
 </code> </code>
  
Line 184: Line 158:
 #!/bin/sh #!/bin/sh
  
-Dependencies: grep, wget, ssh, scp +Exit on error
- +
 set -e set -e
-  
-# Change this to match your router 
-architecture="arm_cortex-a7_neon-vfpv4" 
-target="ipq40xx" 
- 
-# These should be fine unless you've changed something 
-user="root" 
-ip_address="openwrt.lan" 
  
-tmpdir="/tmp/luci-offline"+# Configuration parameters 
 +OWRT_USER="root" 
 +OWRT_HOST="openwrt.lan" 
 +OWRT_TEMP="/tmp/luci-offline"
  
-base="liblua lua libuci-lua libubus libubus-lua uhttpd rpcd" +# Fetch OpenWrt release 
-baseurl="https://downloads.openwrt.org/snapshots/packages/${architecture}/base"+eval $(ssh "${OWRT_HOST}" cat /etc/os-release)
  
-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" +# LuCI packages and repos 
-luciurl="https://downloads.openwrt.org/snapshots/packages/${architecture}/luci"+case "${VERSION_ID}" in 
 +(snapshot) OWRT_URL="https://downloads.${HOME_URL#*//}snapshots/" ;; 
 +(*) 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"
  
-targets="libiwinfo libiwinfo-lua" +# Download packages from repos 
-targetsurl="https://downloads.openwrt.org/snapshots/targets/${target}/generic/packages" +mkdir -p "${OWRT_TEMP}" 
-mkdir -p "${tmpdir}" +for OWRT_REPO in OWRT_CORE OWRT_BASE OWRT_LUCI 
-  +do 
-for pkgdir in base luci targets; do +    OWRT_REPOURL=$(eval echo '${'${OWRT_REPO}'URL}') 
-    url=$(eval echo '${'${pkgdir}'url}') +    wget -N -P "${OWRT_TEMP}/${OWRT_REPOURL##*/}" "${OWRT_REPOURL}/Packages" 
-    echo "${url}/Packages" +    for OWRT_PKG in $(eval echo '${'${OWRT_REPO}'}') 
-    wget -N -P "${tmpdir}" "${url}/Packages" +    do 
-    for pkg in $(eval echo '${'${pkgdir}'}')do +        OWRT_PKGFILE="$(sed ---e 
-        pkgfile="$(grep ---e " ${pkg}[0-9\.]*_.+\.ipk" "${tmpdir}/Packages" | tail -c +2)" +            "/^Filename:\s${OWRT_PKG}[.0-9]*_.+\.ipk/s/^.*\s//p
-        pkgurl="${url}/${pkgfile}" +            "${OWRT_TEMP}/${OWRT_REPOURL##*/}/Packages")" 
-        echo "${pkg} ${pkgurl}" +        OWRT_PKGURL="${OWRT_REPOURL}/${OWRT_PKGFILE}" 
-        wget -q -N -P "${tmpdir}" "${pkgurl}"+        wget -N -P "${OWRT_TEMP}" "${OWRT_PKGURL}"
     done     done
 done done
  
-ssh "${user}@${ip_address}" mkdir -p "${tmpdir}" +# Upload packages to OpenWrt 
-scp "${tmpdir}"/*.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 -f -R "${tmpdir}" +ssh "${OWRT_USER}@${OWRT_HOST}"opkg install ${OWRT_TEMP}/*.ipk" 
-  +ssh "${OWRT_USER}@${OWRT_HOST}"rm -f -R ${OWRT_TEMP}" 
-rm -f -R "${tmpdir}"+rm -f -R "${OWRT_TEMP}"
 </code> </code>
  
Line 231: Line 210:
   * [[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