Heroin with an estimated street value of £4,470 was recovered.
Dean Barclay and Liam Munro, both 36, John Brown, 29, and Courtney Smith, 23, made no plea and were committed for further examination.
All four, from Inverness, were released on bail.
Acting Detective Sergeant Duncan Birse said: “Drugs cause misery in our communities and Police Scotland is committed to disrupting the supply and sale of illegal substances.
“Anyone who has information or concerns about drugs should contact Police Scotland via 101 or make a call anonymously to the charity Crimestoppers on 0800 555 111.”
Four in court after heroin worth thousands found in Inverness