Installation from source is described in documentation.

I tested on GCE instance with Debian 8. Here is just quick summary:

  • download tar with source:
  • untar it:
    tar xvfz postgresql-10beta1.tar.gz
  • switch to root:
    sudo su
  • install/ update libraries:
    apt-get install gcc -y
    apt-get install libreadline-dev -y
    apt-get install zlib1g-dev -y
    apt-get install make -y
  • follow steps from document “install short”:
    make install
    adduser postgres
    mkdir /usr/local/pgsql/data
    chown postgres /usr/local/pgsql/data
    su - postgres
    /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
    /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
    /usr/local/pgsql/bin/createdb test
    /usr/local/pgsql/bin/psql test

Enjoy it 🙂