JustToThePoint English Website Version
JustToThePoint en español

How to set up a new Ubuntu

BASIC SET UP

    # 1. Update package lists and upgrade existing software
    sudo apt update && sudo apt upgrade -y
    # 2. Install required packages
    #  Neovim is a hyperextensible Vim-based text editor.
    # Geany is a powerful, stable and lightweight programmer's text editor.
    # CopyQ, an advanced, open-source clipboard manager.
    # GParted, a free partition editor for graphically managing your disk partition.
    # LocalSend is a free, open-source alternative to AirDrop that works perfectly on Ubuntu.
    sudo apt install gparted ssh nfs-kernel-server neovim geany xauth neovim hugo samba copyq gimp
    sudo snap install localsend
    # 3. Enable passwordless sudo for all members of the %sudo group
    sudo visudo
    # Then change the %sudo line to the following:
    %sudo  ALL=(ALL) NOPASSWD: ALL

    # 4. Mount permanently a disk
    # Create the mount point (if it doesn't already exist)
    sudo mkdir -p /mnt/data

    sudo nvim /etc/fstab
    # Use 'blkid' to print the universally unique identifier for a device
    # Add the disk entry to /etc/fstab
    UUID=ca04070e-a366-424b-8fa3-c9960c9fbdae /mnt/data ext4 defaults 0 2
    # 5. Disable Wayland
    sudo nvim /etc/gdm3/custom.conf
    # Remove the comment: #WaylandEnable = false

POST-Installation

SSH

SSH (Secure Shell) is a widely used secured network protocol to access remote computers in a network.

  1. vim /etc/ssh/sshd_config:
      AllowTcpForwarding yes # It allow TCP port forwarding, using SSH as a tunnel between your client and the server.
      X11Forwarding yes # It will forward GUI traffic over the connection above.
      X11DisplayOffset 10
      X11UseLocalhost yes
    
  2. Restart the sshd service: sudo systemctl restart ssh.
  3. If you want to allow the use of graphical applications, you need to add -Y flag:
      ssh -Y userName@ServerSSHIPAddress
    

Python

  1. Install Python runtime environment: sudo apt install -y python3-full
  2. Install Visual Studio Code: sudo snap install code --classic. Plugins: Windsurf.
  3. Create a Proper Python Project Structure.
    cd /mnt/data/justothepoint
    mkdir mypython
    cd mypython
    
  4. Create Virtual Environment and a Python Project structure.
    # Create Virtual Environment
    python3 -m venv venv
    source venv/bin/activate
    # Upgrade pip
    pip install --upgrade pip
    # Create a Python Project structure to audit our website
    cd /mnt/data/justothepoint
    mkdir mypython
    cd mypython
    
  5. Create a Python project structure
        mypython/
    ├── pyproject.toml
    ├── README.md
    ├── .gitignore
    ├── mypython/
    │   ├── __init__.py
    │   ├── link_checker.py
    │   ├── image_checker.py
    │   ├── image_optimizer.py
    │   ├── markdown_parser.py
    │   └── cli.py
    └── venv/
    
  6. Start Hugo development server automatically/ Visual Studio Code Remote - SSH

Samba

  1. Install Samba: Update the package list and install Samba: sudo apt install samba.
  2. Create Shared Directory, i.e., the folder you want to share: sudo mkdir -p /mnt/data/share; and change its permissions: sudo chown nmaximo7:nmaximo7 /mnt/data/share.
  3. Configure Samba: sudo nvim /etc/samba/smb.conf:
      [sambashare]
        comment = Samba on Ubuntu
        force user = nmaximo7 # It must be the user of the server.
        browseable = yes # Enables Windows clients to browse the shared directory using Windows Explorer.
        path = /mnt/data/share # The path to the shared directory.
        writable = yes # If you want others to be able to change it.
        public = yes # So that everyone can see the shared directory.
    
  4. Restart Samba: sudo systemctl restart smb
  5. Access on Windows. Open File Explorer and enter \\dirIP\sambashare.

SSH, NFS Server, and Remote Desktop Protocol

NFS or Network File System is a distributed file system protocol that allows you to share directories over a network. With NFS, you can mount remote directories on your system and work with the files on the remote machine as if they were local files.

Server Side

  1. Installing the NFS server: sudo apt update && sudo apt install nfs-kernel-server.
  2. Create Shared Directory:
    sudo mkdir -p /mnt/data
    sudo chown -R nobody:nogroup /mnt/data/
    sudo chmod 777 /mnt/data
    
  3. Define Exports. Edit nvim /etc/exports to define which directories are shared and with which clients.
    # Add this line:
    /mnt/nfs_share  client_IP(rw,sync,no_subtree_check)
    # Example: /mnt/data 192.168.1.0/24(rw,sync,no_subtree_check)
    # NFS root directory (/mnt/data). Access to this NFS volume is allowed only to the clients from the 192.168.1.0/24 subnet (local network).
    
  4. Save the file and export the share(s): sudo exportfs -a
  5. Firewall configuration: sudo ufw allow from 192.168.1.0/24 to any port nfs. Verify the change: sudo ufw status
  6. Restart the NFS service after reboot: sudo systemctl restart nfs-kernel-server
  7. Enable the built-in RDP server on the Ubuntu machine: Settings, System, Remote Desktop. Toggle Remote Desktop and Remote Login to On.

Set Up the NFS Clients and Remmina

  1. NixOS Configuration, edit configuration.nix:
    fileSystems."/home/nmaximo7/fileserver" = {
        boot.supportedFilesystems = [ "nfs" "nfs4" ];
        device = "//192.168.1.46:/mnt/data";  # NFS Server path
        fsType = "nfs";
        options = [
            "x-systemd.automount" # Mounts on first access
            "noauto" # Add this to prevent auto-mount at boot (safer for network shares)
        ];
    };
    environment.systemPackages = with pkgs; [
        nfs         # Official NFS client package
        rsync       # Backup tool
        openssh     # SSH client
        remmina     # Remote desktop client
    ];
    
  2. Copy public key to server (requires sudo on Ubuntu server): ssh-copy-id nmaximo7@192.168.1.46
  3. Backup Script:
    # The destination path format is user@host:/remote/path
    BACKUP_DEST="nmaximo7@192.168.1.46:/mnt/data/"
    # Backup with rsync
    # Add --progress for visibility during transfers. Use || to catch errors.
    rsync -av --delete --progress "$HOME/dotfiles/" "$BACKUP_DEST/dotfiles" || echo "Backup failed!"
    
  4. Open Remmina on your NixOS desktop. Create a new connection and select RDP as the protocol. Enter the IP address of the Ubuntu machine, username, and password, then click Connect.
Bitcoin donation

JustToThePoint Copyright © 2011 - 2026 Anawim. ALL RIGHTS RESERVED. Bilingual e-books, articles, and videos to help your child and your entire family succeed, develop a healthy lifestyle, and have a lot of fun. Social Issues, Join us.

This website uses cookies to improve your navigation experience.
By continuing, you are consenting to our use of cookies, in accordance with our Cookies Policy and Website Terms and Conditions of use.