|
| 1 | +# Install self-hosted TimescaleDB on archlinux-based systems |
| 2 | +You can host TimescaleDB yourself, on your Arch Linux system. These |
| 3 | +instructions use the `pacman` package manager. |
| 4 | + |
| 5 | +<highlight type="warning"> |
| 6 | +If you have already installed PostgreSQL using a method other than the `pacman` |
| 7 | +package manager, you could encounter errors following these instructions. It is |
| 8 | +safest to remove any existing PostgreSQL installations before you begin. If you |
| 9 | +want to keep your current PostgreSQL installation, do not install TimescaleDB |
| 10 | +using this method. |
| 11 | +[Install from source](/install/latest/self-hosted/installation-source/) |
| 12 | +instead. |
| 13 | +</highlight> |
| 14 | + |
| 15 | +<procedure> |
| 16 | + |
| 17 | +### Installing self-hosted TimescaleDB on archlinux-based systems |
| 18 | +1. Install TimescaleDB and timescaledb-tune: |
| 19 | + ```bash |
| 20 | + sudo pacman -Syu timescaledb timescaledb-tune |
| 21 | + ``` |
| 22 | +1. Initialize the database as the postgres user: |
| 23 | + ```bash |
| 24 | + sudo -u postgres initdb --locale=en_US.UTF-8 --encoding=UTF8 -D /var/lib/postgres/data --data-checksums |
| 25 | + ``` |
| 26 | +1. Run timescaledb-tune to adjust your `postgresql.conf` file, to use TimescaleDB as PostgreSQL extension: |
| 27 | + ```bash |
| 28 | + sudo timescaledb-tune |
| 29 | + ``` |
| 30 | +1. Enable and start the service: |
| 31 | + ``` |
| 32 | + sudo systemctl enable postgresql.service |
| 33 | + sudo systemctl start postgresql.service |
| 34 | + ``` |
| 35 | + |
| 36 | +</procedure> |
| 37 | + |
| 38 | + |
| 39 | +## Set up the TimescaleDB extension |
| 40 | +When you have PostgreSQL and TimescaleDB installed, you can connect to it from |
| 41 | +your local system using the `psql` command-line utility. This is the same tool |
| 42 | +you might have used to connect to PostgreSQL before, but if you haven't |
| 43 | +installed it yet, check out the [installing psql][install-psql] section. |
| 44 | +
|
| 45 | +<procedure> |
| 46 | +
|
| 47 | +### Setting up the TimescaleDB extension |
| 48 | +1. On your local system, at the command prompt, connect to the PostgreSQL |
| 49 | + instance as the `postgres` superuser: |
| 50 | + ```bash |
| 51 | + sudo -u postgres psql |
| 52 | + ``` |
| 53 | + If your connection is successful, you'll see a message like this, followed |
| 54 | + by the `psql` prompt: |
| 55 | + ``` |
| 56 | + psql (14.3) |
| 57 | + Type "help" for help. |
| 58 | + ``` |
| 59 | +1. At the `psql` prompt, create an empty database. This database is |
| 60 | + called `tsdb`: |
| 61 | + ```sql |
| 62 | + CREATE database tsdb; |
| 63 | + ``` |
| 64 | +1. Connect to the database you created: |
| 65 | + ```sql |
| 66 | + \c tsdb |
| 67 | + ``` |
| 68 | +1. Add the TimescaleDB extension: |
| 69 | + ```sql |
| 70 | + CREATE EXTENSION IF NOT EXISTS timescaledb; |
| 71 | + ``` |
| 72 | +1. You can now connect to your database using this command: |
| 73 | + ```bash |
| 74 | + sudo -u postgres psql tsdb |
| 75 | + ``` |
| 76 | + |
| 77 | +</procedure> |
| 78 | + |
| 79 | +You can check that the TimescaleDB extension is installed by using the `\dx` |
| 80 | +command at the `psql` prompt. It looks like this: |
| 81 | +```sql |
| 82 | +tsdb=# \dx |
| 83 | + List of installed extensions |
| 84 | + Name | Version | Schema | Description |
| 85 | +-------------+---------+------------+------------------------------------------------------------------- |
| 86 | + plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language |
| 87 | + timescaledb | 2.7.0 | public | Enables scalable inserts and complex queries for time-series data |
| 88 | +(2 rows) |
| 89 | +
|
| 90 | +``` |
| 91 | + |
| 92 | +## Where to next |
| 93 | +Now that you have your first TimescaleDB database up and running, you can check |
| 94 | +out the [TimescaleDB][tsdb-docs] section in the documentation, and find out what |
| 95 | +you can do with it. |
| 96 | + |
| 97 | +If you want to work through some tutorials to help you get up and running with |
| 98 | +TimescaleDB and time-series data, check out the [tutorials][tutorials] section. |
| 99 | + |
| 100 | +You can always [contact us][contact] if you need help working something out, or |
| 101 | +if you want to have a chat. |
| 102 | + |
| 103 | + |
| 104 | +[contact]: https://www.timescale.com/contact |
| 105 | +[install-psql]: /timescaledb/:currentVersion:/how-to-guides/connecting/psql/ |
| 106 | +[tsdb-docs]: /timescaledb/:currentVersion:/ |
| 107 | +[tutorials]: /timescaledb/:currentVersion:/tutorials/ |
| 108 | +[config]: /timescaledb/:currentVersion:/how-to-guides/configuration/ |
| 109 | +[releases-page]: https://packagecloud.io/timescale/timescaledb |
0 commit comments