ubuntu doc

  • Author: Admin
  • Published On: 3/17/2026
  • Category: editor
enable firewall ubuntu
	sudo ufw enable
	sudo ufw allow 8080/tcp
	sudo reboot now
# cek listening port 	
	+ sudo ss -tulnp | grep ':80'
	
# error message :  [ Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use ]
	+ sudo ss -tulnp | grep ':80'
	+ sudo pkill -9 nginx
	
# install GUI on ubuntu server 25.04
	+ sudo apt update && sudo apt upgrade -y
	+ Install Lightweight Desktop (XFCE) < sudo apt install xubuntu-desktop -y >
	+ If prompted during install, choose your preferred display manager (usually gdm3 for GNOME or lightdm for XFCE/MATE).
	
# install mysql 8.4 in ubuntu 25.04
	+ 
	+ mysql
	+ CREATE USER 'sap'@'%' IDENTIFIED BY 'sap123ok';
	+ GRANT ALL PRIVILEGES ON . TO 'sap'@'%' WITH GRANT OPTION;
	+ nano /etc/mysql/mysql.conf.d/mysqld.cnf
		+ bind-address = 127.0.0.1 change to bind-address = 0.0.0.0
	+ sudo systemctl restart mysql
	+ sudo ufw allow 3306/tcp
	+ ALTER USER 'sap'@'%%' IDENTIFIED WITH mysql_native_password BY 'sap123ok';
# uninstall mysql 8.4 in ubuntu 25.04
	+ dpkg -l | grep mysql
	+ apt purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-* -y
	+ sudo rm -rf /etc/mysql /var/lib/mysql /var/log/mysql ~/.mysql
	+ apt autoremove -y
	+ apt autoclean	 	
	+ apt update
	+ mysql --version
	
# install mysql 5.7.44 ubuntu server 25.04
	+ download from mysql official [ https://downloads.mysql.com/archives/community/ ]
	+ cd /usr/local/
	+ wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz
	+ tar -xvzf mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz
	+ mv mysql-5.7.44-linux-glibc2.12-x86_64 mysql
	+ sudo groupadd mysql
	+ sudo useradd -r -g mysql -s /bin/false mysql
	+ sudo mkdir mysql-files
	+ sudo chown mysql:mysql mysql-files
	+ sudo chmod 750 mysql-files
	+ sudo chown -R mysql:mysql .
	+ cd mysql
	+ cp support-files/mysql.server /etc/init.d/mysql
	+ chmod +x /etc/init.d/mysql
	+ curl -O http://launchpadlibrarian.net/646633572/libaio1_0.3.113-4_amd64.deb
		+ install it
		+ sudo dpkg -i libaio1_0.3.113-4_amd64.deb
		+ verify
		+ ls -l /usr/lib/x86_64-linux-gnu/libaio.so.1
	+ curl -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.2-0ubuntu2_amd64.deb
		+ install pkg
			+ sudo dpkg -i libncurses5_6.2-0ubuntu2_amd64.deb
		+ verify
			+ sudo apt-get install -f
			+ ls -l /lib/x86_64-linux-gnu/libncurses.so.5
	+ curl -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.2-0ubuntu2_amd64.deb
		+ install pkg
			+ sudo dpkg -i libtinfo5_6.2-0ubuntu2_amd64.deb
		+ verify
			+ sudo apt-get install -f
			+ ls -l /lib/x86_64-linux-gnu/libtinfo.so.5
	+ Initialize MySQL Data Directory (if not done)
		+ sudo bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
	+ bin/mysql -u root -p
	+ pass = [ *Txbr/zDI3rR ]  [ get from first start mysql on script < sudo bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data > ]
	+ reset password
		+ ALTER USER 'root'@'localhost' IDENTIFIED BY 'sap123ok';
	+ CREATE USER 'sap'@'%' IDENTIFIED BY 'sap123ok';
	+ GRANT ALL PRIVILEGES ON . TO 'sap'@'%' WITH GRANT OPTION;
	+ FLUSH PRIVILEGES;
	+ nano /etc/my.cnf
	
		[mysqld]
		basedir=/usr/local/mysql
		datadir=/usr/local/mysql/data
		socket=/tmp/mysql.sock
		log-error=/usr/local/mysql/data/mysqld.log
		pid-file=/usr/local/mysql/data/mysqld.pid
		bind-address = 0.0.0.0
		skip_ssl
		
		+ bind-address = 127.0.0.1 change to bind-address = 0.0.0.0
		
	+ sudo systemctl restart mysql
	+ sudo ufw allow 3306/tcp
	+ ALTER USER 'sap'@'%%' IDENTIFIED WITH mysql_native_password BY 'sap123ok';
	+ start mysql manual 
		./bin/mysqld_safe --defaults-file=./etc/my.cnf --user=mysql &
	+ Start MySQL in safe mode (no password required)
		+ ./bin/mysqld_safe --skip-grant-tables --skip-networking &
	+ sudo cp support-files/mysql.server /etc/init.d/mysql
	+ sudo chmod +x /usr/local/mysql/bin/mysqld_safe
	+ sudo lsof -nP | grep mysqld.sock
	+ sudo ./bin/mysqld_safe --user=mysql --explicit_defaults_for_timestamp &
	+ sudo ./bin/mysqld --initialize --user=mysql --basedir=$(pwd) --datadir=$(pwd)/data 
	+ error check mysql
		+ cd /usr/local/mysql/data
		+ ls -l *.err
	+ kill service ubuntu
	+ sudo kill -9 12345
# Create a Systemd Service		
	+ sudo nano /etc/systemd/system/mysql.service
		
		-->
		
		[Unit]
		Description=MySQL
		After=network.target
		[Service]
		Type=forking
		User=mysql
		Group=mysql
		ExecStart=/usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data
		ExecStop=/usr/local/mysql/bin/mysqladmin shutdown
		Restart=on-failure
		[Install]
		WantedBy=multi-user.target
		
		-->
	
scp [email protected]:/usr/local/mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz
# install ubuntu 25.04 
	+ Select press enter [ English ] 
	+ Select press enter [ Done ]
	+ Only [ Ubuntu Server ] check list [x], Select press enter [ Done ]
	+ Select press enter [ Continue without network ]
	+ Select press enter [ Done ]
	+ Select press enter [ Done ]
	+ Only [ Use an entire disk ],  Select press enter [ Done ]
	+ Select press enter [ Done ]
	+ Select press enter [ Continue ]
	+ input
		+ Your name 			: < ptsap >
		+ Your server name 		: < ptsap_ >
		+ Pick a username		: < sap >
		+ Choose a password		: < sap123ok >
		+ Confirm your password : < sap123ok >
	+ Select press enter [ Done ]
	+ Select [] Install OpenSSH server, press [ space ] keyboard, Select press enter [ Done ]
	+ Remove your flash disc, press enter
	+ After reboot, wait +- 3 minutes for check network
	+ login : sap
	+ pass : sap123ok
	+ set root password	
		+ sudo passwd
		+ [sudo] password for sap: < sap123ok >
		+ new password: < sap123ok >
		+ Retype new password: < sap123ok >
		+ passwd: password update successfully [ if success show message ]
	+ test login root password
		+ su
		+ password: < sap123ok >
		+ root@ptsap:/home/sap# [ if success show ]
	+ config SSH for enable acces to network
		+ login to root user 
		+ cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
		+ nano /etc/ssh/sshd_config
			+ find [ PermitRootLogin prohibit-password ]
			+ remove [ # ]
			+ set [ PermitRootLogin yes ], before [ PermitRootLogin prohibit-password ]
			+ systemctl restart ssh
			+ press [ctrl + x] keyboard
			+ type 
			+ press enter
	+ setting static ip address:
		+ create file [ nano /etc/netplan/01-netcfg.yaml]
		+ add this script ( without --> )
			--->
				network:
				  version: 2
				  renderer: networkd
				  ethernets:
				   enp2s0:
					dhcp4: false
					addresses:
					  - 192.168.0.4/24
					gateway4: 192.168.0.6
					nameservers:
					  addresses: [192.168.0.6]
			--->
		+ press [ctrl + x] keyboard
		+ type 
		+ press enter
	+ plug utp network lan
	+ reboot now
	+ login form laptop using ssh
	+ ssh [email protected]
	+ [email protected]'s password: < sap123ok >
	+ apt update
	+ apt upgrade -y
	
# install docker ubuntu 25.04
	+ sudo apt update
	+ sudo apt upgrade
	+ sudo apt install apt-transport-https ca-certificates curl software-properties-common
	+ sudo mkdir -p /etc/apt/keyrings
	+ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
	+ 
	-->
	
	echo \
	  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
	  https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | \
	  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
	  
	-->  
	+ sudo apt update
	+ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
	+ sudo systemctl start docker
	+ sudo systemctl enable docker
	+ sudo docker --version
	
# reload networking ubuntu
	+ netplan apply
  • Share On: