Ubuntu 20.04: How to update Ubuntu 20.04 in one command

This is a quick guide on how to update Ubuntu 20.04 in one command from the command line so that it will work on server and desktop versions.

The update process is really simple and is basically one command.

Update Ubuntu 20.04 in one command:

Here is how to update Ubuntu 20.04 in one command:

Connect to the Ubuntu 20.04 machine that needs updating.

How to update Ubuntu 20.04 in one command - Needing updates.

Run the following command:

sudo apt-get update && sudo apt-get upgrade -y

When prompted type the user’s password:

How to update Ubuntu 20.04 in one command - update command

Press enter and the update process will start:

How to update Ubuntu 20.04 in one command - updates running

Once finished the update process will return to the login prompt.

Hit the up arrow so that the previous command is on the screen and press enter and the update process will run again and you should see the following message on the screen:

How to update Ubuntu 20.04 in one command - Successfully updated.

You Ubuntu 20.04 machine is now up to date.

For more Ubuntu 20.04 How Too’s click HERE.

Installing Ubuntu 20.04 Server

Here is my step by Step how too of Installing Ubuntu 20.04.1 Server. The process will be the same if you are installing Ubuntu 20.04 Server on a physical machine of in a VM (as below).

Boot the machine from the boot.iso which will boot to the following page:

Installing Ubuntu 20.04.1 Server - Choose Language

Select the language you want to install (English in my case) and click enter.

Installing Ubuntu 20.04.1 Server - Update Installer

If the installer says that there was a new version of the installer available then select Update to the new installer and click enter:

Installing Ubuntu 20.04.1 Server - Update installer press enter

The updater will be updated and then will load the following screen:

Installing Ubuntu 20.04.1 Server - Select language

change the keyboard settings to the correct ones for your system and click Done:

Configure the IP settings and click done. For this installation the default setting was chosen as the address was given by dhcp and ip’s are fixed in dhcp so that the server will get the same IP address all the time.

Installing Ubuntu 20.04.1 Server - LAN config

If a fixed IP is needed then select the interface.

Installing Ubuntu 20.04.1 Server - Select LAN adapter

Select Edit IPv4.

Installing Ubuntu 20.04.1 Server - Manual IP - edit IPv4

Click on Automatic (DHCP).

Installing Ubuntu 20.04.1 Server - Set DHCP

Select Manual.

Installing Ubuntu 20.04.1 Server - Manual IP

Add the IP address details in the next screen and click Save to save the settings.

Installing Ubuntu 20.04.1 Server - Add IP details

This will take you back to the Network Connections page. Click on Done to move to the next screen.

Installing Ubuntu 20.04.1 Server - Done

If you use a proxy server then add the details in the next page. If not click on Done to move to the next page.

Installing Ubuntu 20.04.1 Server - proxy settings

Click Done to use the default mirror or change to a custom one if you prefer.

Installing Ubuntu 20.04.1 Server - select mirror

Select the default to use the entire disk and set up LVM or make a custom setting by selecting Custom storage layout (out of the scope of this post.

Installing Ubuntu 20.04.1 Server - Disk Settings

Choose Done and enter to start the install.

Installing Ubuntu 20.04.1 Server - DONE

Scroll to Continue to go to the Profile setup screen.

Installing Ubuntu 20.04.1 Server - continue
Installing Ubuntu 20.04.1 Server - User details

Add the user details as required.

Installing Ubuntu 20.04.1 Server - User details done.

Click on Done to move to the SSH Setup screen.

Installing Ubuntu 20.04.1 Server - install ssh

If you want ssh installed then select the option if not leave it unticked.

Installing Ubuntu 20.04.1 Server - ssh done

Click Done to move to the Featured Server Snaps.

Installing Ubuntu 20.04.1 Server - install server snaps

Select any Snaps that you want to install (none in this case) and click Done

Installing Ubuntu 20.04.1 Server - server snaps done

The installation will start:

Installing Ubuntu 20.04.1 Server - Install server

Leave the install to run.

After about 10 minutes the install will complete:

Installing Ubuntu 20.04.1 Server - Finished

Click reboot the reboot the install and boot the server to the login screen.

Installing Ubuntu 20.04.1 Server - Reboot

The Server will now boot to the login screen:

Installing Ubuntu 20.04.1 Server - Finished

For ideas on what to configure and install on your server next take a look at my other Ubuntu 20.04 posts HERE.

Disable Windows Server 2012 R2 password expiry

This post explains how to Disable Windows Server 2012 R2 password expiry. The reason that I discovered how to do this was that one of my server’s local Administrator password kept expiring every 45 days which was really annoying. If this was a production server then this is a good security feature but as the server is a demo server then it is really annoying.

As a side note I use really long passwords anyway (20+) characters so the password expiry is not really an issue as there is not technology available to crack the passwords at the moment!

After a bit of clicking through the server policies I found the setting that needed to be changed and was able to disable password expiry entirely on the server.

This is how I Disable Windows Server 2012 R2 users password expiry.

It is not a good idea on an enterprise system but as my server is a test server I wanted to stop the password from expiring every 45 days. Luckily this is a really easy process that takes a couple of minutes to do.

To disable password expiry do the following:

Click on the start bar and type “local security policy” and select Local Security Policy:

Disable Windows Server 2012 R2 users password expiry - Select Local Security Policy

This opens the Local Security Policy Group Policy Snapin:

Disable Windows Server 2012 R2 users password expiry - Local Security Policy

Open Account Policies and click on Password Policy:

Disable Windows Server 2012 R2 users password expiry - Select Password Policy

Double click on Maximum password age:

Disable Windows Server 2012 R2 users password expiry - Change Maximum password age.

Change the default 45 days to a value in days that the password will be changed. In my case I set it to 0 as I don’t want it to ever expire. Click apply to save the changes:

Disable Windows Server 2012 R2 users password expiry - set password age to 0

The password is now set to never expire. Click OK to close the wizard.:

Disable Windows Server 2012 R2 users password expiry - save

You will now see that the minimum password age is now set to 0:

Disable Windows Server 2012 R2 users password expiry - done.

Close the window and you have successfully disabled password expiry on your Windows 2012 R2 server.

As I stated earlier it is really not recommended to have the Local Administrator password set to never expire on a production server and this process should only be done on demo/ dev servers.

For more Windows Server posts click HERE.

How to setup Bookstack Email.

This is how I setup the email on Bookstack. I used the SMTP method as I already have smtp setup on my domain so creating a new email address was quick and easy. My Bookstack environment is installed on a free AWS Ubuntu 20.04 Instance. For more options see the official guide HERE.

The email was setup as follows:

Find the .env file by searching on your server by running the following command:

find / -name *’env

My .env was a hidden file in /var/www/bookstack

How to setup Bookstack Email.- Find .env

Find the file by running the following command:

ls -a

How to setup Bookstack Email.- Find File using Is- A

Edit the .env file:

vim /var/www/bookstack/.env

This will display the .env file:

How to setup Bookstack Email.

The section that need to be updated is the SMTP mail Options:

How to setup Bookstack Email.

My settings were as follows (passwords redacted for security):

How to setup Bookstack Email.

The settings were saved by typing esq plus :wq

The settings were then tested by logging into bookstack as an Admin user and opening Settings:

How to setup Bookstack Email.

And clicking on Maintainance:

How to setup Bookstack Email.

The SEND TEST EMAIL was then pressed:

How to setup Bookstack Email.

If there is an issue with the settings an error message will be shown:

How to setup Bookstack Email.

I originally received this message as I had the MAIL_ENCRYPTION=null when it needed to be MAIL_ENCRYPTION=SSL.

If the settings are correct then you will recieve the following message in the top right of the page:

How to setup Bookstack Email.

You will also receive and email in the logged in user’s inbox:

How to setup Bookstack Email.
How to setup Bookstack Email.

That is the email setup completed. For more Bookstack configuration take a look HERE.

Bookstack Initial Setup

Bookstack is a wiki that organises categories into virtual librarys so that you have the top level of a shelf, then on that shelf you have books and in those books you have chapters and pages. I like this visual way of organising documents as it is very visual and easy to follow.

First of all you will need to create a new shelf. To do this click on the Shelves Button:

Bookstack Initial Setup - Create new shelf

As this is a new installation there will not be any shelves created so click on CREATE ONE NOW:

Bookstack Initial Setup - Create

Fill in the Shelfs name and description

Bookstack Initial Setup - Add Name

As we have no books at the moment we can ignore the Books on this shelf option:

Bookstack Initial Setup - Ignore

If you want to add a cover image to the shelf then expand the Cover image section and either drag the image into the section or click on the SELECT IMAGE button to search for the Image:

Bookstack Initial Setup - Add Cover

The new Image will be displayed:

Bookstack Initial Setup - Select Image

Add Tags if needed:

Bookstack Initial Setup - Add Tags

To add more tags click on Add another tag:

Bookstack Initial Setup - Add more tags

Once finished click on SAVE SHELF:

Bookstack Initial Setup - Save Shelf

The new Shelf will now be shown on the Shelves screen:

Bookstack Initial Setup

The next step is to add a new book. This can be done by clicking on the Create New Book Link:

Bookstack Initial Setup - Add new book

Fill in the details of the new book as you did above for the new Shelf:

Bookstack Initial Setup - Fill in details

Once all the details are adduced click on SAVE BOOK:

Bookstack Initial Setup - Save Book

You will now be taken to the chapter setup page:

Bookstack Initial Setup - Chapter setup

Click on Create Add a new chapter to add a new chapter:

Bookstack Initial Setup - Add new chapter

Add the chapter details:

Bookstack Initial Setup - add chapter details

Once all the details are added click the SAVE CHAPTER button:

Bookstack Initial Setup - Save chapter

You will then be taken to the new page creation page.

Create a new page by clicking the Create new page link:

Bookstack Initial Setup- Create new page link

Add the title to the new page in the title field:

Bookstack Initial Setup - add title

Add the contents of the document in the document field:

Bookstack Initial Setup - add content of document

Once the contents of the document is complete click on Save Page:

Bookstack Initial Setup - Save page

This will take you to the view of the page:

Bookstack Initial Setup - View Page

You can now add more Shelves, books or pages as required in the same way as before.

For more Books stack how too’s click HERE.

For the official Bookstack documents page click HERE.

Bookstack User creation

For more Bookstack articles take a look HERE. For the official Bookstack documentation take a look HERE.

In order to create a user in Bookstack you need to log into Bookstack with an Admin user and do the following:

Click on Settings to open the settings page:

Bookstack User creation

Click on the Users button at the top of the page:

Bookstack User creation

Click ADD NEW USER to open the add new user page:

Bookstack User creation

Add the new user’s Full name and Email address:

Bookstack User creation

Set the users permission level. Admin has full control access, Editor can create and edit documents, Public can view Public accessible documents and Viewer can view documents:

Bookstack User creation

Untick Send user invite by email:

Bookstack User creation

Add the password and confirm the password and:

Bookstack User creation

Click Save to save the new user:

Bookstack User creation

The new user will now be listed in the Users list:

Bookstack User creation

You have now successfully created an new Bookstack user.

Installing Bookstack wiki on AWS free instance.

This guide is how I installed Bookstack Wiki on my AWS Free instance Ubuntu 20.04 server:

Bookstack has a handy Ubuntu 20.04 Installation script that can be run on a fresh install of Ubuntu 20.04 to automatically install Bookstack and the prerequisite software needed for it to run (Apache, MySQL 8.0 & PHP-7.4).

The script can be found at: https://www.bookstackapp.com/docs/admin/installation/

The process is really simple but for some reason the page has been locked so you can not copy and paste from it!:

Download the script by running:

https://raw.githubusercontent.com/BookStackApp/devops/master/scripts/installation-ubuntu-20.04.sh

Installing Bookstack wiki on AWS free instance.

Change the downloaded script to make it executable:

chmod a+x installation-ubuntu-20.04.sh

You will now see that the script is executable:

Installing Bookstack wiki on AWS free instance.

Run the script by running:

sudo ./installation-ubuntu-20.04.sh

The script will then ask for the fqdn so add what you would like the site to be called. I used wiki.ithowtoo.com and pressed enter.

Let the script run.

It will ask if you want to run Composer as root/super user:

Installing Bookstack wiki on AWS free instance.

I chose Yes as its the only user I have and the install continued:

Installing Bookstack wiki on AWS free instance.

When the script has finished you will see a similar message to the one below:

Installing Bookstack wiki on AWS free instance.

From the ASW interface an inbound rule was created to allow https:

Installing Bookstack wiki on AWS free instance.

You will then be able to get to the login page:

Installing Bookstack wiki on AWS free instance.

Login using the default user and password given by the script:

User Email = admin@admin.com

password = password

On first login you will be advised to change the default password for security reasons:

Installing Bookstack wiki on AWS free instance.

Click OK.

To edit the Admin user details click on Admin in the top left corner of the page:

Installing Bookstack wiki on AWS free instance.

Select Edit Profile:

Installing Bookstack wiki on AWS free instance.

Edit the details to your details:

Installing Bookstack wiki on AWS free instance.

Click save to save the details:

Installing Bookstack wiki on AWS free instance.

You will now see your new user in the list of users as an Admin:

Installing Bookstack wiki on AWS free instance.

Click on the user icon in the top left corner of the page and select Logout to log out of the page and then log in with the new user to make sure everything works as it should:

Installing Bookstack wiki on AWS free instance.

I have also setup a new A record for wiki.mydomain to point to the external IP address of the server so that I can access the site via wiki.domain instead of the external IP address.

The final security measure is to set the mysql root password as it is not setup by default.

Log into mysql by typing:

mysql

You will then see the mysql prompt:

Installing Bookstack wiki on AWS free instance.

Type the following to set the root password to password:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'PASSWORD';
Installing Bookstack wiki on AWS free instance.

Obviously you will want to change the PASSWORD to something more secure.

You will then need to quit mysql by typing quit. This will take you back to the normal command line:

Installing Bookstack wiki on AWS free instance.

At the command prompt stop the MySQL daemon by typing:

sudo systemctl stop mysql

With the daemon stopped issue the following command:

sudo mysqld -init-file=~/mysql-pwd

Start the daemon:

sudo systemctl start mysql

You should now be able to access mysql using the root user by typing:

mysql -u root -p

Installing Bookstack wiki on AWS free instance.

You have now successfully installed Bookstack on an AWS free instance.

For more documents on Bookstack configuration go click HERE.