Extensions
Extension Repositories
By default, DuckDB extensions are installed from a single repository containing extensions built and signed by the core
DuckDB team. This ensures the stability and security of the core set of extensions. These extensions live in the default `core` repository
which points to `http://extensions.duckdb.org`.  
Besides the core repository, DuckDB also supports installing extensions from other repositories. For example, the `core_nightly` repository contains nightly builds for core extensions
that are built for the latest stable release of DuckDB. This allows users to try out new features in extensions before they are officially published.  
#### Installing Extensions from a Repository {#docs:extensions:working_with_extensions::installing-extensions-from-a-repository}  
To install extensions from the default repository (default repository: `core`):  
```sql
INSTALL httpfs;
```  
To explicitly install an extension from the core repository, run either of:  
```sql
INSTALL httpfs FROM core;
```  
Or:  
```sql
INSTALL httpfs FROM 'http://extensions.duckdb.org';
```  
To install an extension from the core nightly repository:  
```sql
INSTALL spatial FROM core_nightly;
```  
Or:  
```sql
INSTALL spatial FROM 'http://nightly-extensions.duckdb.org';
```  
To install an extensions from a custom repository unknown to DuckDB:  
```sql
INSTALL ⟨custom_extension⟩ FROM 'https://my-custom-extension-repository';
```  
Alternatively, the `custom_extension_repository` setting can be used to change the default repository used by DuckDB:  
```sql
SET custom_extension_repository = 'http://nightly-extensions.duckdb.org';
```  
While any URL or local path can be used as a repository, DuckDB currently contains the following predefined repositories:  
<div class="narrow_tabl"></div>  
| Alias                 | URL                                      | Description                                                                            |
|:----------------------|:-----------------------------------------|:---------------------------------------------------------------------------------------|
| `core`                | `http://extensions.duckdb.org`           | DuckDB core extensions                                                                 |
| `core_nightly`        | `http://nightly-extensions.duckdb.org`   | Nightly builds for `core`                                                              |
| `community`           | `http://community-extensions.duckdb.org` | DuckDB community extensions                                                            |
| `local_build_debug`   | `./build/debug/repository`               | Repository created when building DuckDB from source in debug mode (for development)    |
| `local_build_release` | `./build/release/repository`             | Repository created when building DuckDB from source in release mode (for development)  |  
#### Working with Multiple Repositories {#docs:extensions:working_with_extensions::working-with-multiple-repositories}  
When working with extensions from different repositories, especially mixing `core` and `core_nightly`, it is important to keep track of the origins
and version of the different extensions. For this reason, DuckDB keeps track of this in the extension installation metadata. For example:  
```sql
INSTALL httpfs FROM core;
INSTALL aws FROM core_nightly;
SELECT extension_name, extension_version, installed_from, install_mode FROM duckdb_extensions();
```  
This outputs:  
<div class="narrow_table monospace_table"></div>  
| extensions_name | extensions_version | installed_from | install_mode |
|:----------------|:-------------------|:---------------|:-------------|
| httpfs          | 62d61a417f         | core           | REPOSITORY   |
| aws             | 42c78d3            | core_nightly   | REPOSITORY   |
| ...             | ...                | ...            | ...          |  
#### Creating a Custom Repository {#docs:extensions:working_with_extensions::creating-a-custom-repository}  
A DuckDB repository is an HTTP, HTTPS, S3, or local file based directory that serves the extensions files in a specific structure.
This structure is described in the [“Downloading Extensions Directly from S3” section](#::downloading-extensions-directly-from-s3), and is the same
for local paths and remote servers, for example:  
```text
base_repository_path_or_url
└── v1.0.0
└── osx_arm64
├── autocomplete.duckdb_extension
├── httpfs.duckdb_extension
├── icu.duckdb_extension
├── inet.duckdb_extension
├── json.duckdb_extension
├── parquet.duckdb_extension
├── tpcds.duckdb_extension
├── tpcds.duckdb_extension
└── tpch.duckdb_extension
```  
See the [`extension-template` repository](https://github.com/duckdb/extension-template/) for all necessary code and scripts
to set up a repository.  
When installing an extension from a custom repository, DuckDB will search for both a gzipped and non-gzipped version. For example:  
```sql
INSTALL icu FROM '⟨custom repository⟩';
```  
The execution of this statement will first look `icu.duckdb_extension.gz`, then `icu.duckdb_extension` in the repository's directory structure.  
If the custom repository is served over HTTPS or S3, the [`httpfs` extension](#docs:extensions:httpfs:overview) is required. DuckDB will attempt to [autoload](#docs:extensions:overview::autoloading-extensions)
the `httpfs` extension when an installation over HTTPS or S3 is attempted.