Cannot upgrade from 2.2.6 to 2.3 via composer

First be sure you are running PHP 7.1 or 7.2

Update your composer

run those commandes:

composer require magento/product-community-edition=2.3.0 --no-update

Specify additional packages for composer Run this

composer require --dev phpunit/phpunit:~6.2.0 friendsofphp/php-cs-fixer:~2.10.1 lusitanian/oauth:~0.8.10 pdepend/pdepend:2.5.2 sebastian/phpcpd:~3.0.0 squizlabs/php_codesniffer:3.2.2 --no-update

Remove unused packages

composer remove --dev sjparkinson/static-review fabpot/php-cs-fixer --no-update

Update autoload

Open composer.json and edit the "autoload": "psr-4" section to include "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/" :

"Magento\\Framework\\": "lib/internal/Magento/Framework/",
"Magento\\Setup\\": "setup/src/Magento/Setup/",
"Magento\\": "app/code/Magento/",
"Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"

Apply updates

composer update

Clear caches and generated content

rm -rf <Magento install dir>/var/cache/*
rm -rf <Magento install dir>/var/page_cache/*
rm -rf <Magento install dir>/generated/code/*

Update the database schema and data

php bin/magento setup:upgrade

Disable maintenance mode

php bin/magento maintenance:disable

Clear the cache, reindex, if you get a server error tray to deploy static content.

and that's all,

You can check the full explanation here