# Connecting to an External Database in Craft CMS

DevFeed: [Connecting to an External Database in Craft CMS](<https://devfeed.tech/articles/connecting-to-an-external-database-in-craft-cms-31247.md>)

Original publisher: [Read original article](<https://nystudio107.com/blog/connecting-to-an-external-database-in-craft-cms>)

Author: andrew@nystudio107.com (Andrew Welch)

Published: 2024-08-06T14:03:00Z

Content type: tutorial

Language: en

Sources: [nystudio107 | Articles on modern web development.](<https://devfeed.tech/sources/nystudio107-articles-on-modern-web-development.md>)

Topics: [Databases](<https://devfeed.tech/topics/databases.md>), [Content Management System](<https://devfeed.tech/topics/cms.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [MySQL](<https://devfeed.tech/topics/mysql.md>), [MariaDB](<https://devfeed.tech/topics/mariadb.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [SQLite](<https://devfeed.tech/topics/sqlite.md>), [legacy](<https://devfeed.tech/topics/legacy.md>)

Tags: [application](<https://devfeed.tech/tags/application.md>), [built-in](<https://devfeed.tech/tags/built-in.md>), [cms](<https://devfeed.tech/tags/cms.md>), [components](<https://devfeed.tech/tags/components.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [connect](<https://devfeed.tech/tags/connect.md>), [craft](<https://devfeed.tech/tags/craft.md>), [database](<https://devfeed.tech/tags/database.md>), [external](<https://devfeed.tech/tags/external.md>), [flexibility](<https://devfeed.tech/tags/flexibility.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [insights](<https://devfeed.tech/tags/insights.md>), [learn](<https://devfeed.tech/tags/learn.md>), [legacy](<https://devfeed.tech/tags/legacy.md>), [leveraging](<https://devfeed.tech/tags/leveraging.md>), [mariadb](<https://devfeed.tech/tags/mariadb.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>), [using](<https://devfeed.tech/tags/using.md>)

## AI overview

A tutorial explaining how to connect Craft CMS to an external database using Twig and configuration in config/app.php, without requiring the deprecated Connect plugin. It covers Craft application components and database types supported through Yii2.

## Source excerpt

Learn how to connect to an external database using Craft CMS by leveraging the built-in flexibility of application components