Install PostgreSQL
1.os:Ubuntu 18.04.3 LTS
# lsb_release -a
LSB Version: core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
2.Use apt-get to install postgresql.
The installer creates a systemd init script that runs postgresql as daemon on system startup. Follow the installation instructions for Ubuntu as follow:
sudo apt-get update
sudo apt-get install postgresql postgresql-client
output
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Fetched 252 kB in 0s (531 kB/s)
Reading package lists... Done
...
Setting up nginx-core (1.14.0-0ubuntu1.7) ...
Not attempting to start NGINX, port 80 is already in use.
Setting up nginx (1.14.0-0ubuntu1.7) ...
3.Check everything installed correctly
# psql --version
output
psql (PostgreSQL) 14.17 (Ubuntu 14.17-0ubuntu0.22.04.1)
4.Change the default PostgreSQL password:
sudo -u postgres psql
ALTER USER postgres PASSWORD 'newpassword';
\q
# 启动服务并设置开机自启
sudo systemctl start postgresql
sudo systemctl enable postgresql
sudo systemctl status postgresql
sudo systemctl restart postgresql
Uninstall Nginx on Ubuntu 18.04(aliyun)
step 1:
sudo apt-get remove nginx nginx-common # Removes all but config files.
or
sudo apt-get purge nginx nginx-common # Removes everything
step 2:
sudo apt-get autoremove # After using any of the above commands, use this in order to remove dependencies used by nginx which are no longer required.
Reinstall
To recreate it, first uninstall using purge to remove even configuration files and records:
# Run these commands as your normal login (e.g. "michael")
# Remove any existing versions of nginx
sudo apt-get remove '^nginx.*$'
# Setup a sources.list.d file for the nginx repository
cat << 'EOF' | sudo tee /etc/apt/sources.list.d/nginx.list
deb http://nginx.org/packages/ubuntu/ precise nginx
deb-src http://nginx.org/packages/ubuntu/ precise nginx
EOF
# Add nginx key
curl http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
# install nginx
sudo apt-get update && sudo apt-get -y install nginx
then reinstall:
apt-get install nginx
Host ASP.NET Core on Linux with Nginx
https://www.postgresql.org/docs/current/admin.html
https://blog.illixion.com/2025/03/zitadel-setup-guide/