Set up the repository

Update the apt package index and install packages to allow apt to use a repository over HTTPS:

$ sudo apt-get update
$ sudo apt-get install \
 ca-certificates \
 curl \
 gnupg \
 lsb-release

Add Docker’s official GPG key:

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Use the following command to set up the stable repository.

 echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker Engine

Update the apt package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:

$ sudo apt-get update
 $ sudo apt-get install docker-ce docker-ce-cli containerd.io

Verify that Docker Engine is installed correctly by running the hello-world image.

$ sudo docker run hello-world

This command downloads a test image and runs it in a container.

Docker Engine is installed and running. The docker group is created but no users are added to it. You need to use sudo to run Docker commands. Continue to Linux postinstall to allow non-privileged users to run Docker commands and for other optional configuration steps.

Manage Docker as a non-root user. To create the docker group and add your user:

$ sudo groupadd docker

Add your user to the docker group.

$ sudo usermod -aG docker $USER

Log out and log back in so that your group membership is re-evaluated. If testing on a virtual machine, it may be necessary to restart the virtual machine for changes to take effect. On a desktop Linux environment such as X Windows, log out of your session completely and then log back in. On Linux, you can also run the following command to activate the changes to groups:

# newgrp docker 

Verify that you can run docker commands without sudo.

$ docker run hello-world

This command downloads a test image and runs it in a container.

Configure Docker to start on boot

sudo systemctl enable docker.service
sudo systemctl enable containerd.service

Configure where the Docker daemon listens for connections

By default, the Docker daemon listens for connections on a UNIX socket to accept requests from local clients. It is possible to allow Docker to accept requests from remote hosts by configuring it to listen on an IP address and port as well as the UNIX socket. For more detailed information on this configuration option take a look at “Bind Docker to another host/port or a unix socket” section of the Docker CLI Reference article.

Before configuring Docker to accept connections from remote hosts it is critically important that you understand the security implications of opening docker to the network. If steps are not taken to secure the connection, it is possible for remote non-root users to gain root access on the host. For more information on how to use TLS certificates to secure this connection, check this article on how to protect the Docker daemon socket.

Configuring Docker to accept remote connections can be done with the docker.service systemd unit file for Linux distributions using systemd, such as recent versions of RedHat, CentOS, Ubuntu and SLES, or with the daemon.json file which is recommended for Linux distributions that do not use systemd.

systemd vs daemon.json

Configuring Docker to listen for connections using both the systemd unit file and the daemon.json file causes a conflict that prevents Docker from starting.

Configuring remote access with systemd unit file.
Use the command sudo systemctl edit docker.service to open an override file for docker.service in a text editor.

Add or modify the following lines, substituting your own values.

    [Service]
    ExecStart=
    ExecStart=/usr/bin/dockerd -H fd:// -H tcp://127.0.0.1:2375

Save the file. Reload the systemctl configuration.

 $ sudo systemctl daemon-reload

Restart Docker.

$ sudo systemctl restart docker.service

Check to see whether the change was honored by reviewing the output of netstat to confirm dockerd is listening on the configured port.

$ sudo netstat -lntp | grep dockerd

Configuring remote access with daemon.json

Set the hosts array in the /etc/docker/daemon.json to connect to the UNIX socket and an IP address, as follows:

    {
      "hosts": ["unix:///var/run/docker.sock", "tcp://127.0.0.1:2375"]
    }

Restart Docker.

Check to see whether the change was honored by reviewing the output of netstat to confirm dockerd is listening on the configured port.

 sudo netstat -lntp | grep dockerd

Ref:
https://docs.docker.com/engine/install/ubuntu/
https://docs.docker.com/engine/install/linux-postinstall/

Set up the repository
Update the apt package index and install packages to allow apt to use a repository over HTTPS:

$ sudo apt-get update
$ sudo apt-get install ca-certificates curl gnupg lsb-release

Add Docker’s official GPG key:

$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Use the following command to set up the stable repository.

echo \
 "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker Engine

Update the apt package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:

$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

Verify that Docker Engine is installed correctly by running the hello-world image.

$ sudo docker run hello-world

Configure Docker to start on boot

$ sudo systemctl enable docker.service
$ sudo systemctl enable containerd.service

Manage Docker as a non-root user
Create the docker group.

sudo groupadd docker

Add your user to the docker group.

sudo usermod -aG docker $USER

Log out and log back in so that your group membership is re-evaluated. If testing on a virtual machine, it may be necessary to restart the virtual machine for changes to take effect. On a desktop Linux environment such as X Windows, log out of your session completely and then log back in.

On Linux, you can also run the following command to activate the changes to groups:

newgrp docker 

Verify that you can run docker commands without sudo.

$ docker run hello-world

This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.

Configuring remote access with systemd unit file

Use the command sudo systemctl edit docker.service to open an override file for docker.service in a text editor. Add or modify the following lines, substituting your own values.

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://127.0.0.1:2375

Save the file. Reload the systemctl configuration.

 sudo systemctl daemon-reload

Restart Docker.

 sudo systemctl restart docker.service

Check to see whether the change was honored by reviewing the output of netstat to confirm dockerd is listening on the configured port.

$ sudo netstat -lntp | grep dockerd

Configuring remote access with daemon.json

Set the hosts array in the /etc/docker/daemon.json to connect to the UNIX socket and an IP address, as follows:

    {
      "hosts": ["unix:///var/run/docker.sock", "tcp://127.0.0.1:2375"]
    }

Restart Docker. Check to see whether the change was honored by reviewing the output of netstat to confirm dockerd is listening on the configured port.

 sudo netstat -lntp | grep dockerd

Ref:
https://docs.docker.com/engine/install/debian/
https://docs.docker.com/engine/install/linux-postinstall/

This article show how to install xrdp on Debian 11. This assumes you have no desktop installed. If you have a desktop, then you can omit the install for it below.

sudo apt update
sudo apt -y install xrdp
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  xorgxrdp
Suggested packages:
  guacamole xrdp-pulseaudio-installer
The following NEW packages will be installed:
  xorgxrdp xrdp
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 506 kB of archives.
After this operation, 3,238 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 xrdp amd64 0.9.12-1.1 [446                                                                                                                                                             kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 xorgxrdp amd64 1:0.2.12-1                                                                                                                                                             [59.9 kB]
Fetched 506 kB in 1s (791 kB/s)
Selecting previously unselected package xrdp.
(Reading database ... 141298 files and directories currently installed.)
Preparing to unpack .../xrdp_0.9.12-1.1_amd64.deb ...
Unpacking xrdp (0.9.12-1.1) ...
Selecting previously unselected package xorgxrdp.
Preparing to unpack .../xorgxrdp_1%3a0.2.12-1_amd64.deb ...
Unpacking xorgxrdp (1:0.2.12-1) ...
Setting up xrdp (0.9.12-1.1) ...

Generating 2048 bit rsa key...

ssl_gen_key_xrdp1 ok

saving to /etc/xrdp/rsakeys.ini

Created symlink /etc/systemd/system/multi-user.target.wants/xrdp-sesman.service →                                                                                                                                                             /lib/systemd/system/xrdp-sesman.service.
Created symlink /etc/systemd/system/multi-user.target.wants/xrdp.service → /lib/s                                                                                                                                                            ystemd/system/xrdp.service.
Setting up xorgxrdp (1:0.2.12-1) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13+deb11u3) ...
sudo systemctl status xrdp
● xrdp.service - xrdp daemon
     Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-03-26 08:28:09 CDT; 3min 35s ago
       Docs: man:xrdp(8)
             man:xrdp.ini(5)
    Process: 3663 ExecStartPre=/bin/sh /usr/share/xrdp/socksetup (code=exited, status=0/SUCCESS)
    Process: 3671 ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS (code=exited, status=0/SUCCESS)
   Main PID: 3672 (xrdp)
      Tasks: 1 (limit: 4663)
     Memory: 768.0K
        CPU: 17ms
     CGroup: /system.slice/xrdp.service
             └─3672 /usr/sbin/xrdp

Mar 26 08:28:08 testing xrdp[3671]: (3671)(139708485990208)[INFO ] address [0.0.0.0] port [3389] mode 1
Mar 26 08:28:08 testing xrdp[3671]: (3671)(139708485990208)[INFO ] listening to port 3389 on 0.0.0.0
Mar 26 08:28:08 testing xrdp[3671]: (3671)(139708485990208)[INFO ] xrdp_listen_pp done
Mar 26 08:28:08 testing xrdp[3671]: (3671)(139708485990208)[DEBUG] Closed socket 7 (AF_INET6 :: port 3389)
Mar 26 08:28:08 testing systemd[1]: xrdp.service: Can't open PID file /run/xrdp/xrdp.pid (yet?) after start: Operation not permitted
Mar 26 08:28:09 testing systemd[1]: Started xrdp daemon.
Mar 26 08:28:10 testing xrdp[3672]: (3672)(139708485990208)[INFO ] starting xrdp with pid 3672
Mar 26 08:28:10 testing xrdp[3672]: (3672)(139708485990208)[INFO ] address [0.0.0.0] port [3389] mode 1
Mar 26 08:28:10 testing xrdp[3672]: (3672)(139708485990208)[INFO ] listening to port 3389 on 0.0.0.0
Mar 26 08:28:10 testing xrdp[3672]: (3672)(139708485990208)[INFO ] xrdp_listen_pp done
sudo adduser xrdp ssl-cert
Adding user `xrdp' to group `ssl-cert' ...
Adding user xrdp to group ssl-cert
Done.
sudo ufw allow 3389
sudo systemctl restart xrdp

MAKE SURE YOU ARE LOGGED OUT OF THE SERVER TO TEST RDP. NOW RDP TO THE SERVER.

Try to RDP to the server. For Debian 11, The XRDP package results in an error.

The problem seems to happens only with Gnome Desktop. Based the the bug/issue reported to the team behind xrdp software (see https://github.com/neutrinolabs/xorgxrdp/issues/156), the problem is only present when using the xorgxrdp package version 0.2.12. this is a known issue with version xorgxrdp-0.2.12.
The proposed solution is to upgrade to a previous versions xrdp 0.9.15-1 and xorgxrdp 1:0.2.15-1.

These versions are still compatible with libc6 on Debian Bullseye. This is important to note, because I initially tried newer versions of xorgxrdp and xrdp and one of them required a newer version of libc6.

Until a backport is available (mailing list to ask for a backport to bullseye-backports can be found here: https://lists.debian.org/debian-backports/) you can download xrdp 0.9.15-1 and xorgxrdp 1:0.2.15-1 via https://snapshot.debian.org/
Those package versions were still compatible with libc6 from bullseye.

# wget https://snapshot.debian.org/archive/debian/20210302T032219Z/pool/main/x/xorgxrdp/xorgxrdp_0.2.15-1_amd64.deb
# wget https://snapshot.debian.org/archive/debian/20210302T032219Z/pool/main/x/xrdp/xrdp_0.9.15-1_amd64.deb
# sudo apt install ./xorgxrdp_0.2.15-1_amd64.deb
# sudo apt install ./xrdp_0.9.15-1_amd64.deb

Now, RDP should work.

How to update Ubuntu

$ sudo apt update
$ sudo apt upgrade

Info from man apt-get:

update
update is used to resynchronize the package index files from their sources. The indexes of available packages are fetched from the location(s) specified in /etc/apt/sources.list. For example, when using a Debian archive, this command retrieves and scans the Packages.gz files, so that information about new and updated packages is available. An update should always be performed before an upgrade or dist-upgrade. Please be aware that the overall progress meter will be incorrect as the size of the package files cannot be known in advance.

upgrade
upgrade is used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list. Packages currently installed with new versions available are retrieved and upgraded; under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed. New versions of currently installed packages that cannot be upgraded without changing the install status of another package will be left at their current version. An update must be performed first so that apt-get knows that new versions of packages are available.

dist-upgrade
dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get has a “smart” conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. The dist-upgrade command may therefore remove some packages. The /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files. See also apt_preferences(5) for a mechanism for overriding the general settings for individual packages.

The main distinction between apt-get upgrade and apt-get dist-upgrade is that in the former, none of the packages are removed. Software packages with newer versions are upgraded and none whatsoever are removed. In the latter, some newer packages are installed, and some are removed to satisfy certain dependencies.

Error in WordPress Toolkit when updating.

Selected items were updated with errors:
The following errors have occurred while updating WordPress instance #1 ('https://www.captainscbdshop.com'):
- Unable to update plugin 'akismet`4.1.12`1`', details: Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes) in /home/captainscbdshop/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php on line 199
Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes) in /home/captainscbdshop/public_html/wp-includes/plugin.php on line 439

- Unable to update plugin 'creative-mail-by-constant-contact`1.4.6`1`', details: Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes) in /home/captainscbdshop/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php on line 693
Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes) in /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/php-cli-tools/lib/cli/Colors.php on line 1

- Unable to update plugin 'jetpack`10.1`1`', details: Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes) in /home/captainscbdshop/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php on line 199
Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes) in /home/captainscbdshop/public_html/wp-includes/plugin.php on line 439

- Unable to update plugin 'woocommerce`5.7.1`1`', details: Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes) in /home/captainscbdshop/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php on line 199
Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes) in /home/captainscbdshop/public_html/wp-includes/plugin.php on line 439

- Unable to update plugin 'woocommerce-services`1.25.18`1`', details: Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 65536 bytes) in /home/captainscbdshop/public_html/wp-includes/widgets/class-wp-widget-rss.php on line 136
Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 65536 bytes) in /home/captainscbdshop/public_html/wp-includes/class-wp-fatal-error-handler.php on line 45

Checking for updates was performed with errors:
Failed to reset cache for the instance #1: Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes) in /home/captainscbdshop/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php on line 509
Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 4096 bytes) in /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/composer/ClassLoader.php on line 427

Solution

In File Manager, Edit the file and change the lower memory limit:

public_html/wp-includes/default-constants.php

Change From:

// Define memory limits.
	if ( ! defined( 'WP_MEMORY_LIMIT' ) ) {
		if ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) {
			define( 'WP_MEMORY_LIMIT', $current_limit );
		} elseif ( is_multisite() ) {
			define( 'WP_MEMORY_LIMIT', '64M' );
		} else {
			define( 'WP_MEMORY_LIMIT', '40M' );
		}
	}

Cange to:

// Define memory limits.
	if ( ! defined( 'WP_MEMORY_LIMIT' ) ) {
		if ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) {
			define( 'WP_MEMORY_LIMIT', $current_limit );
		} elseif ( is_multisite() ) {
			define( 'WP_MEMORY_LIMIT', '64M' );
		} else {
			define( 'WP_MEMORY_LIMIT', '128M' );
		}
	}

In WordPress Toolkit, re-run check for updates. Now you can update.

To install Samba, we run:

sudo apt update
sudo apt install samba

We can check if the installation was successful by running:

whereis samba

The following should be its output:

samba: /usr/sbin/samba /usr/lib/x86_64-linux-gnu/samba /etc/samba /usr/share/samba /usr/share/man/man8/samba.8.gz /usr/share/man/man7/samba.7.gz

Setting up Samba

Now that Samba is installed, we need to create a use and directory for it to share:
Add a user

# adduser roger
Adding user `roger' ...
Adding new group `roger' (1000) ...
Adding new user `roger' (1000) with group `roger' ...
Creating home directory `/home/roger' ...
Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for roger
Enter the new value, or press ENTER for the default
        Full Name []: Roger
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n] y

Add a directory to share (replace your username here).

mkdir /home/roger/sambashare/

The command above creates a new folder sambashare in our home directory which we will share later.

The configuration file for Samba is located at /etc/samba/smb.conf. To add the new directory as a share, we edit the file. Lets backup first.

cp /etc/samba/smb.conf /etc/samba/smb.conf-bk
sudo nano /etc/samba/smb.conf

Workgroup- make sure Workgroup is the same for your Windows box.

workgroup = WORKGROUP

At the bottom of the file, add the following lines:

[sambashare]
    comment = Samba on Ubuntu
    path = /home/username/sambashare
    read only = no
    browsable = yes

Then press Ctrl-O to save and Ctrl-X to exit from the nano text editor.
What we’ve just added

comment: A brief description of the share.

path: The directory of our share.

read only: Permission to modify the contents of the share folder is only granted when the value of this directive is no.

browsable: When set to yes, file managers such as Ubuntu’s default file manager will list this share under “Network” (it could also appear as browseable).

Now that we have our new share configured, save it and restart Samba for it to take effect:

sudo service smbd restart

Update the firewall rules to allow Samba traffic:

sudo ufw allow samba

Setting up User Accounts and Connecting to Share

Since Samba doesn’t use the system account password, we need to set up a Samba password for our user account:

sudo smbpasswd -a username

Note
Username used must belong to a system account, else it won’t save.
Connecting to Share

On Ubuntu: Open up the default file manager and click Connect to Server then enter:

smb://ip-address/sambashare

On Windows, open up File Manager and edit the file path to:

\\ip-address\sambashare

Note: ip-address is the Samba server IP address and sambashare is the name of the share.

You’ll be prompted for your credentials. Enter them to connect!

Excellent Article here: https://tecadmin.net/mounting-samba-share-on-ubuntu/

Cuda Toolkit on Ubuntu WSL

https://developer.nvidia.com/cuda-downloads?target_os=Linux

Uninstall all linux distributions.
Uninstall WSL (right-click on the windows start logo> App and Features> Enable or disable windows features> uncheck the box for Windows Subsystem for Linux).
Restart the computer.
Open PowerShell in administrator mode and perform the simplified installation of WSL, as it already (i) enables the optional WSL and Virtual Machine Platform components, (ii) downloads and installs the latest Linux kernel, (iii) defines WSL 2 as the default and (iv) download and install an Ubuntu distribution (Just to inform you, I had previously performed the manual installation):

PS C:\Users\sanam> wsl.exe –install
PS C:\Users\sanam> exit

Restart your computer, and wait while Ubuntu boots.
Within Ubuntu, enter the new user account and password.
Run the commands for installing and configuring the CUDA Toolkit:

$ sudo su

Enter your password to have root access and update Ubuntu.

/home/san# apt update
/home/san# apt upgrade

Then, follow the CUDA Toolkit Documentation > CUDA on WSL tutorial at https://docs.nvidia.com/cuda/wsl-user-guide/index.html 26, which is the same as the video “GPU Accelerated Machine Learning with WSL 2 “from Youtube:

/home/san# apt-key adv –fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub 9

/home/san# sh -c ‘echo “deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 6 /”> /etc/apt/sources.list.d/cuda.list’

/home/san# apt-get update

/home/san# apt-get install -y cuda-toolkit-11-0

Running a CUDA application:

/home/san# cd /usr/local /cuda/samples/4_Finance/BlackScholes

/usr/local /cuda/samples/4_Finance/BlackScholes# make

/usr/local /cuda/samples/4_Finance/BlackScholes# ./BlackScholes

To install and use WP-CLI, you will need access to your server’s command line. Administrators with root access can log in with SSH. cPanel users can log in with SSH if it’s available or cPanel’s built-in Terminal.

Download WP-CLI

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Change Permissions

chmod +x wp-cli.phar

To allow every user to run WP-CLI, we have to move it to a directory in the system’s PATH.

mv wp-cli.phar /usr/local/bin/wp

This moves the file to “/usr/local/bin,” Renames it to “wp”. Now, all users should be able to run WP-CLI from as “wp.”

To test as a cPanel user, lo into the terminal.

Run the following:

# wp

Output:

NAME

  wp

DESCRIPTION

  Manage WordPress through the command-line.

SYNOPSIS

  wp <command>

SUBCOMMANDS

  akismet               Filter spam comments.
  cache                 Adds, removes, fetches, and flushes the WP Object Cache object.
  cap                   Adds, removes, and lists capabilities of a user role.
  cli                   Reviews current WP-CLI info, checks for updates, or views defined aliases.
  comment               Creates, updates, deletes, and moderates comments.
  config                Generates and reads the wp-config.php file.
  core                  Downloads, installs, updates, and manages a WordPress installation.
  cron                  Tests, runs, and deletes WP-Cron events; manages WP-Cron schedules.
  db                    Performs basic database operations using credentials stored in wp-config.php.
  embed                 Inspects oEmbed providers, clears embed cache, and more.
  eval                  Executes arbitrary PHP code.
  eval-file             Loads and executes a PHP file.
  export                Exports WordPress content to a WXR file.
  help                  Gets help on WP-CLI, or on a specific command.
  i18n                  Provides internationalization tools for WordPress projects.
  import                Imports content from a given WXR file.
  language              Installs, activates, and manages language packs.
  maintenance-mode      Activates, deactivates or checks the status of the maintenance mode of a site.
  media                 Imports files as attachments, regenerates thumbnails, or lists registered image sizes.
  menu                  Lists, creates, assigns, and deletes the active theme's navigation menus.
  network               Perform network-wide operations.
  option                Retrieves and sets site options, including plugin and WordPress settings.
  package               Lists, installs, and removes WP-CLI packages.
  plugin                Manages plugins, including installs, activations, and updates.
  post                  Manages posts, content, and meta.
  post-type             Retrieves details on the site's registered post types.
  redis                 Enables, disabled, flushes, and checks the status of the object cache.
  rewrite               Lists or flushes the site's rewrite rules, updates the permalink structure.
  role                  Manages user roles, including creating new roles and resetting to defaults.
  scaffold              Generates code for post types, taxonomies, plugins, child themes, etc.
  search-replace        Searches/replaces strings in the database.
  server                Launches PHP's built-in web server for a specific WordPress installation.
  shell                 Opens an interactive PHP console for running and testing PHP code.
  sidebar               Lists registered sidebars.
  site                  Creates, deletes, empties, moderates, and lists one or more sites on a multisite installation.
  super-admin           Lists, adds, or removes super admin users on a multisite installation.
  taxonomy              Retrieves information about registered taxonomies.
  term                  Manages taxonomy terms and term meta, with create, delete, and list commands.
  theme                 Manages themes, including installs, activations, and updates.
  transient             Adds, gets, and deletes entries in the WordPress Transient Cache.
  user                  Manages users, along with their roles, capabilities, and meta.
  widget                Manages widgets, including adding and moving them within sidebars.

GLOBAL PARAMETERS

  --path=<path>
      Path to the WordPress files.

  --url=<url>
      Pretend request came from given URL. In multisite, this argument is how the target site is specified.

  --ssh=[<scheme>:][<user>@]<host|container>[:<port>][<path>]
      Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant").

  --http=<http>
      Perform operation against a remote WordPress installation over HTTP.

  --user=<id|login|email>
      Set the WordPress user.

  --skip-plugins[=<plugins>]
      Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded.

  --skip-themes[=<themes>]
      Skip loading all themes, or a comma-separated list of themes.

  --skip-packages
      Skip loading all installed packages.

  --require=<path>
      Load PHP file before running the command (may be used more than once).

  --exec=<php-code>
      Execute PHP code before running the command (may be used more than once).

  --context=<context>
      Load WordPress in a given context.

  --[no-]color
      Whether to colorize the output.

  --debug[=<group>]
      Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help.

  --prompt[=<assoc>]
      Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values.

  --quiet
      Suppress informational messages.

  Run 'wp help <command>' to get more information on a specific command.

In order to get the latest version of Redis, we will use apt to install it from the official Ubuntu repositories.

Update your local apt package cache and install Redis by typing:

$ sudo apt update
$ sudo apt install redis-server

This will download and install Redis and its dependencies.

If on A regular Ubuntu distribution, change the configuration for the server to run as a service.

Open this file with your preferred text editor:

$ sudo nano /etc/redis/redis.conf

Change the following:

supervised no

Change as below.

supervised systemd

Restart

# sudo systemctl restart redis.service

On WSL ubuntu:

sudo /etc/init.d/redis-server restart

Start by checking that the Redis service is running:

$ sudo systemctl status redis

on WSL ubuntu

$ sudo /etc/init.d/redis-server status
* redis-server is running

To test that Redis is functioning correctly, connect to the server using the command-line client:

$ redis-cli

In the prompt that follows, test connectivity with the ping command:

127.0.0.1:6379>ping
PONG