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/22 00:19] – [Offline installation] remove duplicates 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:
Line 110: Line 102:
   * [[packages:pkgdata: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 ====
Line 121: Line 116:
 === Basic === === Basic ===
   * [[packages:pkgdata:liblua5.1.5|liblua]]   * [[packages:pkgdata:liblua5.1.5|liblua]]
-  * [[packages:pkgdata:lua]] +  * [[packages:pkgdata:libubus20220601|libubus]]
-  * [[packages:pkgdata:libuci-lua]] +
-  * [[packages:pkgdata:libubus20191227|libubus]]+
   * [[packages:pkgdata:libubus-lua]]   * [[packages:pkgdata:libubus-lua]]
-  * [[packages:pkgdata:uhttpd]] +  * [[packages:pkgdata:libuci-lua]] 
-  * [[packages:pkgdata:rpcd]]+  * [[packages:pkgdata:lua]]
   * [[packages:pkgdata:luci-base]]   * [[packages:pkgdata:luci-base]]
   * [[packages:pkgdata:luci-lib-ip]]   * [[packages:pkgdata:luci-lib-ip]]
 +  * [[packages:pkgdata:luci-lib-jsonc]]
   * [[packages:pkgdata:luci-lib-nixio]]   * [[packages:pkgdata:luci-lib-nixio]]
-  * [[packages:pkgdata:luci-theme-bootstrap]] 
   * [[packages:pkgdata:luci-mod-admin-full]]   * [[packages:pkgdata:luci-mod-admin-full]]
-  * [[packages:pkgdata:luci-lib-jsonc]]+  * [[packages:pkgdata:luci-theme-bootstrap]] 
 +  * [[packages:pkgdata:rpcd]] 
 +  * [[packages:pkgdata:uhttpd]]
  
-=== Extras ===+=== Extended ===
   * [[packages:pkgdata:luci]]   * [[packages:pkgdata:luci]]
   * [[packages:pkgdata:luci-app-firewall]]   * [[packages:pkgdata:luci-app-firewall]]
-  * [[packages:pkgdata:luci-lib-ipkg]]+  * [[packages:pkgdata:luci-app-opkg]] 
 +  * [[packages:pkgdata:luci-proto-ipv6]]
   * [[packages:pkgdata:luci-proto-ppp]]   * [[packages:pkgdata:luci-proto-ppp]]
  
-Download the packages to the directory ''luci-offline'', transfer it to your router onto the RAM diskand install the packages.+Transfer the downloaded packages to your router onto the RAM disk and install them.
  
 <code bash> <code bash>
 # Upload packages to the router # Upload packages to the router
-scp -luci-offline root@openwrt.lan:/tmp/luci-offline+ssh root@openwrt.lan mkdir -p /tmp/luci-offline 
 +scp *.ipk root@openwrt.lan:/tmp/luci-offline
  
 # Install packages # Install packages
Line 161: Line 158:
 #!/bin/sh #!/bin/sh
  
-Dependencies: sed, wget, ssh, scp+Exit on error 
 +set -e
  
 # Configuration parameters # Configuration parameters
 OWRT_USER="root" OWRT_USER="root"
 OWRT_HOST="openwrt.lan" OWRT_HOST="openwrt.lan"
-OWRT_TEMP="$(mktemp -d -t luci-XXXXXX)"+OWRT_TEMP="/tmp/luci-offline"
  
 # Fetch OpenWrt release # Fetch OpenWrt release
-eval $(ssh openwrt cat /etc/openwrt_release) +eval $(ssh "${OWRT_HOST}" cat /etc/os-release)
-if [ "${DISTRIB_RELEASE}" = "SNAPSHOT"+
-then OWRT_DIR="snapshots" +
-else OWRT_DIR="releases/${DISTRIB_RELEASE}" +
-fi+
  
 # LuCI packages and repos # LuCI packages and repos
-OWRT_URL="https://downloads.openwrt.org"+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_CORE="libiwinfo libiwinfo-lua"
-OWRT_COREURL="${OWRT_URL}/${OWRT_DIR}/targets/${DISTRIB_TARGET}/packages" +OWRT_COREURL="${OWRT_URL}targets/${OPENWRT_BOARD}/packages" 
-OWRT_BASE="liblua lua libuci-lua libubus libubus-lua uhttpd rpcd" +OWRT_BASE="libjson-c2 liblua lua libuci-lua libubus libubus-lua uhttpd rpcd" 
-OWRT_BASEURL="${OWRT_URL}/${OWRT_DIR}/packages/${DISTRIB_ARCH}/base"+OWRT_BASEURL="${OWRT_URL}packages/${OPENWRT_ARCH}/base"
 OWRT_LUCI="luci-base liblucihttp liblucihttp-lua luci-lib-ip luci-lib-nixio \ 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-theme-bootstrap luci-mod-admin-full luci-lib-jsonc luci-mod-status \
     luci-mod-system luci-mod-network"     luci-mod-system luci-mod-network"
-OWRT_LUCIURL="${OWRT_URL}/${OWRT_DIR}/packages/${DISTRIB_ARCH}/luci"+OWRT_LUCIURL="${OWRT_URL}packages/${OPENWRT_ARCH}/luci"
  
 # Download packages from repos # Download packages from repos
Line 191: Line 188:
 do do
     OWRT_REPOURL=$(eval echo '${'${OWRT_REPO}'URL}')     OWRT_REPOURL=$(eval echo '${'${OWRT_REPO}'URL}')
-    wget -N -P "${OWRT_TEMP}" "${OWRT_REPOURL}/Packages"+    wget -N -P "${OWRT_TEMP}/${OWRT_REPOURL##*/}" "${OWRT_REPOURL}/Packages"
     for OWRT_PKG in $(eval echo '${'${OWRT_REPO}'}')     for OWRT_PKG in $(eval echo '${'${OWRT_REPO}'}')
     do     do
         OWRT_PKGFILE="$(sed -n -r -e \         OWRT_PKGFILE="$(sed -n -r -e \
             "/^Filename:\s${OWRT_PKG}[.0-9]*_.+\.ipk/s/^.*\s//p" \             "/^Filename:\s${OWRT_PKG}[.0-9]*_.+\.ipk/s/^.*\s//p" \
-            "${OWRT_TEMP}/Packages")"+            "${OWRT_TEMP}/${OWRT_REPOURL##*/}/Packages")"
         OWRT_PKGURL="${OWRT_REPOURL}/${OWRT_PKGFILE}"         OWRT_PKGURL="${OWRT_REPOURL}/${OWRT_PKGFILE}"
         wget -N -P "${OWRT_TEMP}" "${OWRT_PKGURL}"         wget -N -P "${OWRT_TEMP}" "${OWRT_PKGURL}"
Line 203: Line 200:
  
 # Upload packages to OpenWrt # Upload packages to OpenWrt
-scp -"${OWRT_TEMP}" "${OWRT_USER}@${OWRT_HOST}:${OWRT_TEMP}" +ssh "${OWRT_USER}@${OWRT_HOST}" "mkdir -p ${OWRT_TEMP}" 
-ssh "${OWRT_USER}@${OWRT_HOST}" opkg install "${OWRT_TEMP}"/*.ipk +scp "${OWRT_TEMP}/"*.ipk "${OWRT_USER}@${OWRT_HOST}:${OWRT_TEMP}" 
-ssh "${OWRT_USER}@${OWRT_HOST}" rm -f -R "${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}" rm -f -R "${OWRT_TEMP}"
 </code> </code>
Line 212: 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